Skip to content

Commit ada6782

Browse files
authored
Fix TypeError when API returns null for results array
1 parent 7a990e4 commit ada6782

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Responses/Moderations/CreateResponse.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public static function from(array $attributes, MetaInformation $meta): self
4343
{
4444
$results = array_map(fn (array $result): CreateResponseResult => CreateResponseResult::from(
4545
$result
46-
), $attributes['results']);
46+
), $attributes['results'] ?? []);
4747

4848
return new self(
4949
$attributes['id'],

0 commit comments

Comments
 (0)