Skip to content

Commit 4823298

Browse files
committed
Treat null as zero for Enum assignments
1 parent fe8318e commit 4823298

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/PHPFUI/ORM/Enum.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public function getValue(array $parameters) : mixed
1111
{
1212
$enum = $parameters[0];
1313

14-
return $enum::from($this->currentRecord->offsetGet($this->fieldName));
14+
return $enum::from($this->currentRecord->offsetGet($this->fieldName) ?? 0);
1515
}
1616

1717
/**

0 commit comments

Comments
 (0)