Skip to content

Commit

Permalink
If no parameters passed return empty array rather than null (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
PhiloNL authored Apr 21, 2024
2 parents de6886c + 41182d2 commit 08d2a37
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Http/Controllers/EmbedController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public function __invoke(Request $request)
{
$components = collect($request->json('components', []))->mapWithKeys(function ($component) {
$componentName = $component['name'];
$componentParams = json_decode($component['params'], true);
$componentParams = json_decode($component['params'], true) ?? [];

if (WireExtender::isEmbeddable($componentName) === false) {
return [$componentName => null];
Expand Down

0 comments on commit 08d2a37

Please sign in to comment.