Skip to content

Commit 0acde6a

Browse files
committed
fix(entity): add null coalescing fallback for json_decode in jsonSerialize
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent 0dd48a5 commit 0acde6a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/Db/FieldDefinition.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public function jsonSerialize(): array {
9595
'initial_visibility' => $this->getInitialVisibility(),
9696
'sort_order' => $this->getSortOrder(),
9797
'active' => $this->getActive(),
98-
'options' => $rawOptions !== null ? json_decode($rawOptions, true) : null,
98+
'options' => $rawOptions !== null ? (json_decode($rawOptions, true) ?? null) : null,
9999
'created_at' => $this->getCreatedAt()->format(DATE_ATOM),
100100
'updated_at' => $this->getUpdatedAt()->format(DATE_ATOM),
101101
];

0 commit comments

Comments
 (0)