guard against non-array values in stringify
Tara L Andrews [Mon, 27 Aug 2012 18:05:04 +0000 (20:05 +0200)]
lib/stemmaweb/Controller/Stexaminer.pm

index 3c8b7bd..309f8d6 100644 (file)
@@ -88,8 +88,11 @@ sub index :Path :Args(1) {
 
 sub _stringify_element {
        my( $hash, $key ) = @_;
-       my $str = join( ', ', @{$hash->{$key}} );
-       $hash->{$key} = $str;
+       return undef unless exists $hash->{$key};
+       if( ref( $hash->{$key} ) eq 'ARRAY' ) {
+               my $str = join( ', ', @{$hash->{$key}} );
+               $hash->{$key} = $str;
+       }
 }
 
 =head2 graphsvg