From fbd10e04e73ae319f1c59f37344a60e9d640fe9d Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Mon, 17 Sep 2018 10:32:03 +0200 Subject: [PATCH] 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 --- src/PVE/CLIFormatter.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.39.2