From: Tara L Andrews Date: Mon, 27 Aug 2012 18:05:04 +0000 (+0200) Subject: guard against non-array values in stringify X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8603127ad78e554759b5d2c2a844371a04db4673;p=scpubgit%2Fstemmaweb.git guard against non-array values in stringify --- diff --git a/lib/stemmaweb/Controller/Stexaminer.pm b/lib/stemmaweb/Controller/Stexaminer.pm index 3c8b7bd..309f8d6 100644 --- a/lib/stemmaweb/Controller/Stexaminer.pm +++ b/lib/stemmaweb/Controller/Stexaminer.pm @@ -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