Skip to content

Commit 0fa8d0d

Browse files
author
n.gnato
committed
Check input data for nullable id
1 parent 9bfbcfb commit 0fa8d0d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/FreeElephants/JsonApi/DTO/AbstractResourceObject.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class AbstractResourceObject
1515

1616
public function __construct(array $data)
1717
{
18-
$this->id = $data['id'];
18+
$this->id = $data['id'] ?? null;
1919
$this->type = $data['type'];
2020

2121
$concreteClass = new \ReflectionClass($this);

0 commit comments

Comments
 (0)