From: Dietmar Maurer Date: Fri, 17 Jan 2014 08:16:00 +0000 (+0100) Subject: avoid unnecessary warning X-Git-Url: https://git.proxmox.com/?p=librados2-perl.git;a=commitdiff_plain;h=23c2cb25b699819ef4d9f7d470e8c639b19333fb avoid unnecessary warning --- diff --git a/PVE/RADOS.pm b/PVE/RADOS.pm index d379450..f607fea 100644 --- a/PVE/RADOS.pm +++ b/PVE/RADOS.pm @@ -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; }