Skip to content
This repository was archived by the owner on Feb 7, 2024. It is now read-only.

Commit e67fe38

Browse files
committed
Avoid taking null into consideration.
1 parent 793dc24 commit e67fe38

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Dashboard/Http/Controllers/SendMessage.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,12 @@ public function __invoke(Request $request)
3535
]);
3636

3737
try {
38+
$decodedData = @json_decode($request->data, true);
39+
3840
$broadcaster->broadcast(
3941
[$request->channel],
4042
$request->event,
41-
json_decode($request->data, true)
43+
$decodedData ?: []
4244
);
4345
} catch (Exception $e) {
4446
return response()->json([

0 commit comments

Comments
 (0)