From dc80cea51c5c902c6d7a9b56b12aba3955f243ce Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Sun, 15 Jan 2017 11:04:02 +0100 Subject: [PATCH] Formatter/HTML: only display description if we have one --- PVE/APIServer/Formatter/HTML.pm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/PVE/APIServer/Formatter/HTML.pm b/PVE/APIServer/Formatter/HTML.pm index e3c5f85..b19e3e8 100644 --- a/PVE/APIServer/Formatter/HTML.pm +++ b/PVE/APIServer/Formatter/HTML.pm @@ -178,12 +178,14 @@ PVE::APIServer::Formatter::register_formatter($portal_format, sub { $html .= $doc->alert(text => "Error $res->{status}: $res->{message}"); } - my $info = $res->{info}; + my $lnk; - $html .= $doc->el(tag => 'h3', text => 'Description'); - $html .= $doc->el(tag => 'p', text => $info->{description}); + if (my $info = $res->{info}) { + $html .= $doc->el(tag => 'h3', text => 'Description'); + $html .= $doc->el(tag => 'p', text => $info->{description}); - my $lnk = PVE::JSONSchema::method_get_child_link($info); + $lnk = PVE::JSONSchema::method_get_child_link($info); + } if ($lnk && $data && $data->{data} && HTTP::Status::is_success($res->{status})) {