Skip to content

Commit 76b1731

Browse files
added invalid instance ID message if the id is incorrect
1 parent fd99a83 commit 76b1731

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

modules/servers/AMP/AMP.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -469,8 +469,13 @@ function AMP_AdminServicesTabFields(array $params)
469469
{
470470
$vars[$e['DisplayName']] = $e['Uri'] ? ('<a target="_blank" href="'.$e['Uri'].'" target="_blank">'.$e['Endpoint'].'</a>') : $e['Endpoint'];
471471
}
472+
if ($instance){
473+
$instanceState= $instance['Running'] ? 'Running' : 'Stopped';
474+
}else{
475+
$instanceState='Invalid Instance ID';
476+
}
472477
return [
473-
'State' => $instance['Running'] ? 'Running' : 'Stopped',
478+
'State' => $instanceState,
474479
'Instance ID' => '<input type="hidden" name="amp_original_instanceId" value="' . htmlspecialchars($service->instanceId) . '" />'
475480
. '<input type="text" name="amp_instance_id" value="' . htmlspecialchars($service->instanceId) . '" />',
476481
'Target ID' => '<input type="hidden" name="amp_original_targetId" value="' . htmlspecialchars($service->targetId) . '" />'
@@ -565,7 +570,12 @@ function AMP_ClientArea(array $params)
565570
}
566571
}
567572

568-
$vars['state'] = $instance['Running'] ? 'Running' : 'Stopped';
573+
if ($instance){
574+
$instanceState = $instance['Running'] ? 'Running' : 'Stopped';
575+
}else{
576+
$instanceState='Invalid Instance ID - Contact Support';
577+
}
578+
$vars['state'] = $instanceState;
569579

570580
}
571581
else

0 commit comments

Comments
 (0)