Skip to content

Commit

Permalink
If $resource is null, return default false
Browse files Browse the repository at this point in the history
  • Loading branch information
Claudio-Emmolo committed May 27, 2024
1 parent 7ba2725 commit 578bb25
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/App/Http/Controllers/BusyController.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ public function isBusy(Request $request)

$resource = $this->getResource($request['model-id'], $request['model-name']);

if(! $resource) {
return response()->json([
'success' => false,
'data' => null,
'lastUpdate' => null,
]);
}

return response()->json([
'success' => $resource->isBusy(),
'data' => $resource->isBusy() ? $resource->busyData() : null,
Expand Down

0 comments on commit 578bb25

Please sign in to comment.