From: miker Date: Fri, 18 Feb 2005 18:27:17 +0000 (+0000) Subject: fixing to allow empty strings, and must be called as a class method X-Git-Tag: osrf_rel_2_0_1~1781 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=a9f830896ad3c8e813e654375d2271c559329c9b;p=OpenSRF.git fixing to allow empty strings, and must be called as a class method git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@91 9efc2488-bf62-4759-914b-345cdb29e865 --- diff --git a/src/perlmods/JSON.pm b/src/perlmods/JSON.pm index dac7bca..cbdbc3e 100644 --- a/src/perlmods/JSON.pm +++ b/src/perlmods/JSON.pm @@ -38,7 +38,10 @@ sub register_class_hint { sub JSON2perl { my ($class, $json) = @_; - $json ||= $class; + + if (!defined($json)) { + return undef; + } #$json =~ s/\/\/.+$//gmo; # remove C++ comments $json =~ s/(?