]> git.proxmox.com Git - librados2-perl.git/commitdiff
avoid unnecessary warning
authorDietmar Maurer <dietmar@proxmox.com>
Fri, 17 Jan 2014 08:16:00 +0000 (09:16 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 17 Jan 2014 08:17:14 +0000 (09:17 +0100)
PVE/RADOS.pm

index d3794509c46304e81a58b8637f5b671573ec7eb1..f607fea2130b88e97c7854facdc36408fe6dbb66 100644 (file)
@@ -74,7 +74,7 @@ sub mon_command {
     my $json = encode_json($cmd);
     my $raw = pve_rados_mon_command($self->{conn}, [ $json ]);
     if ($cmd->{format} && $cmd->{format} eq 'json') {
-       return decode_json($raw);
+       return length($raw) ? decode_json($raw) : undef;
     }
     return $raw;
 }