]> git.proxmox.com Git - pve-http-server.git/commitdiff
Formatter/HTML: only display description if we have one
authorDietmar Maurer <dietmar@proxmox.com>
Sun, 15 Jan 2017 10:04:02 +0000 (11:04 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Sun, 15 Jan 2017 10:04:02 +0000 (11:04 +0100)
PVE/APIServer/Formatter/HTML.pm

index e3c5f8512f1d1f6698dc5570deea3a604339534d..b19e3e81d495dd2fcc4ef2d8e4d14718440e55e5 100644 (file)
@@ -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})) {