From a9f830896ad3c8e813e654375d2271c559329c9b Mon Sep 17 00:00:00 2001 From: miker Date: Fri, 18 Feb 2005 18:27:17 +0000 Subject: [PATCH] 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 --- src/perlmods/JSON.pm | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) 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/(?