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 authored and nilmerg committed Aug 21, 2023
1 parent 2eaf1e6 commit 1aaa95e
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);

This comment has been minimized.

Copy link
@nilmerg

nilmerg Aug 22, 2023

Member

HtmlElement does not accept strings as content. Please create a new pr fixing this.

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 1aaa95e

Please sign in to comment.