Skip to content

Commit

Permalink
fix: error while counting attachment when attachment is null
Browse files Browse the repository at this point in the history
fix error: count(): Argument #1 ($value) must be of type Countable|array, null given
  • Loading branch information
ardzz authored Aug 1, 2024
1 parent 23c0801 commit 4e2fbbc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Livewire/ChatBox.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public function form(Form $form): Form
return false;
})
->required(function (Get $get) {
if (count($get('attachments')) > 0) {
if (is_array($get('attachments')) && count($get('attachments')) > 0) {
return false;
}

Expand Down

0 comments on commit 4e2fbbc

Please sign in to comment.