Skip to content

Commit 69352c2

Browse files
committed
🚑 fix(systems) Avoid PHP error and unclear error message if server has no mac address
issue #5748
1 parent 9d362fc commit 69352c2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

systems/admin/systems/class_serverService.inc

+7
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,13 @@ class ServerService extends simpleManagement
316316
);
317317
} else {
318318
$target = $this->parent->getBaseObject()->macAddress;
319+
if (empty($target)) {
320+
msg_dialog::display(
321+
sprintf(_('Could not get execute action %s on service %s.'), $action, $service),
322+
_('This server has no mac address.'), ERROR_DIALOG
323+
);
324+
return;
325+
}
319326
if (is_array($target)) {
320327
$target = $target[0];
321328
}

0 commit comments

Comments
 (0)