fix(PushServerUpdateJob): add null checks before updating application and database statuses
This commit is contained in:
parent
7af9725076
commit
0369909408
1 changed files with 8 additions and 5 deletions
|
|
@ -317,13 +317,16 @@ private function updateServiceSubStatus(string $serviceId, string $subType, stri
|
|||
}
|
||||
if ($subType === 'application') {
|
||||
$application = $service->applications()->where('id', $subId)->first();
|
||||
$application->status = $containerStatus;
|
||||
$application->save();
|
||||
if ($application) {
|
||||
$application->status = $containerStatus;
|
||||
$application->save();
|
||||
}
|
||||
} elseif ($subType === 'database') {
|
||||
$database = $service->databases()->where('id', $subId)->first();
|
||||
$database->status = $containerStatus;
|
||||
$database->save();
|
||||
} else {
|
||||
if ($database) {
|
||||
$database->status = $containerStatus;
|
||||
$database->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue