diff --git a/src/Data/TaskDetails.php b/src/Data/TaskDetails.php index ab5d0bc..fc313f0 100644 --- a/src/Data/TaskDetails.php +++ b/src/Data/TaskDetails.php @@ -13,7 +13,7 @@ public function __construct( public string $description, public string $previewType, public string $id, - public Note $notes, + public ?Note $notes, public Collection $references, public Collection $checklist, ) { @@ -36,7 +36,7 @@ public static function fromData(array $data): self description: Arr::get($data, 'description'), previewType: Arr::get($data, 'previewType'), id: Arr::get($data, 'id'), - notes: Note::fromData(Arr::get($data, 'notes')), + notes: Arr::has($data, 'notes') ? Note::fromData(Arr::get($data, 'notes')) : null, references: $references, checklist: $checklist );