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=b203d1c4ae45a50d5f5c14e4f4a4b10566eb67ec;p=scpubgit%2Fstemmatology.git guard against non-array values in stringify --- diff --git a/stemmaweb/lib/stemmaweb/Controller/Stexaminer.pm b/stemmaweb/lib/stemmaweb/Controller/Stexaminer.pm index 3c8b7bd..309f8d6 100644 --- a/stemmaweb/lib/stemmaweb/Controller/Stexaminer.pm +++ b/stemmaweb/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