Skip to content

Commit b5b4ad3

Browse files
authored
Merge pull request #1623 from nowackipawel/patch-30
Property was not cast if was defined as nullable.
2 parents 1c01ed6 + 327c41c commit b5b4ad3

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

system/Entity.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,9 +428,13 @@ protected function mutateDate($value)
428428

429429
protected function castAs($value, string $type)
430430
{
431-
if (substr($type, 0, 1) === '?' && $value === null)
431+
if(substr($type,0,1) === '?')
432432
{
433-
return null;
433+
if($value === null)
434+
{
435+
return null;
436+
}
437+
$type = substr($type,1);
434438
}
435439

436440
switch($type)

0 commit comments

Comments
 (0)