Commit 69352c2f authored by Côme Chilliet's avatar Côme Chilliet
Browse files

:ambulance: fix(systems) Avoid PHP error and unclear error message if server has no mac address

issue #5748
Showing with 7 additions and 0 deletions
+7 -0
...@@ -316,6 +316,13 @@ class ServerService extends simpleManagement ...@@ -316,6 +316,13 @@ class ServerService extends simpleManagement
); );
} else { } else {
$target = $this->parent->getBaseObject()->macAddress; $target = $this->parent->getBaseObject()->macAddress;
if (empty($target)) {
msg_dialog::display(
sprintf(_('Could not get execute action %s on service %s.'), $action, $service),
_('This server has no mac address.'), ERROR_DIALOG
);
return;
}
if (is_array($target)) { if (is_array($target)) {
$target = $target[0]; $target = $target[0];
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment