From: Dominik Csapak Date: Mon, 17 Sep 2018 08:32:03 +0000 (+0200) Subject: fix #1914: CLIFormatter: check also for existence of 'type' X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=commitdiff_plain;h=fbd10e04e73ae319f1c59f37344a60e9d640fe9d fix #1914: CLIFormatter: check also for existence of 'type' we sometimes define result => {} on an api call, so check that result->{type} is defined and guess the type if not Signed-off-by: Dominik Csapak --- diff --git a/src/PVE/CLIFormatter.pm b/src/PVE/CLIFormatter.pm index 4702180..3040323 100644 --- a/src/PVE/CLIFormatter.pm +++ b/src/PVE/CLIFormatter.pm @@ -409,7 +409,7 @@ sub print_api_result { my $format = $options->{'output-format'} // 'text'; - if ($result_schema) { + if ($result_schema && defined($result_schema->{type})) { return if $result_schema->{type} eq 'null'; } else { my $type = $guess_type->($data);