Skip to content

Commit fb6cc8c

Browse files
committed
MediaGallery must have at least one item
1 parent 94bc95a commit fb6cc8c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Discord/Builders/Components/MediaGallery.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ public function getItems(): array
8888
*/
8989
public function jsonSerialize(): array
9090
{
91+
if (empty($this->items)) {
92+
throw new \DomainException('MediaGallery must have at least one item.');
93+
}
94+
9195
return [
9296
'type' => $this->type,
9397
'items' => $this->items,

0 commit comments

Comments
 (0)