Skip to content

Commit

Permalink
ObjectInspectionDetail: Render EmptyState message if $command is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
sukhwinder33445 committed Aug 21, 2023
1 parent 3aedcca commit 43f5a9b
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions library/Icingadb/Common/ObjectInspectionDetail.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,12 @@ protected function createLastCheckResult()
'active'
];

$execCommand = new HtmlElement(
'pre',
null,
Text::create($command)
);

CopyToClipboard::attachTo($execCommand);
if ($command) {
$execCommand = new HtmlElement('pre', null, $command);
CopyToClipboard::attachTo($execCommand);
} else {
$execCommand = new EmptyState(t('n. a.'));
}

return [
new HtmlElement('h2', null, Text::create(t('Executed Command'))),
Expand Down

0 comments on commit 43f5a9b

Please sign in to comment.