diff --git a/src/Pages/Properties/Option.php b/src/Pages/Properties/Option.php index 74e33f0b..f0a8ea79 100644 --- a/src/Pages/Properties/Option.php +++ b/src/Pages/Properties/Option.php @@ -51,7 +51,7 @@ public static function fromArray(array $array): self $id = $array["id"] ?? null; $name = $array["name"] ?? null; - $color = $array["color"]; + $color = $array["color"] ?? self::COLOR_DEFAULT; return new self($id, $name, $color); } diff --git a/src/Pages/Properties/Select.php b/src/Pages/Properties/Select.php index ce874296..54510496 100644 --- a/src/Pages/Properties/Select.php +++ b/src/Pages/Properties/Select.php @@ -46,7 +46,7 @@ public static function fromArray(array $array): self /** @psalm-var SelectJson $array */ $property = Property::fromArray($array); - $option = Option::fromArray($array[self::TYPE]); + $option = Option::fromArray($array[self::TYPE] ?? []); return new self($property, $option); }