Skip to content

Commit

Permalink
Merge pull request #1623 from nowackipawel/patch-30
Browse files Browse the repository at this point in the history
Property was not cast if was defined as nullable.
  • Loading branch information
lonnieezell authored Dec 30, 2018
2 parents 1c01ed6 + 327c41c commit b5b4ad3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions system/Entity.php
Original file line number Diff line number Diff line change
Expand Up @@ -428,9 +428,13 @@ protected function mutateDate($value)

protected function castAs($value, string $type)
{
if (substr($type, 0, 1) === '?' && $value === null)
if(substr($type,0,1) === '?')
{
return null;
if($value === null)
{
return null;
}
$type = substr($type,1);
}

switch($type)
Expand Down

0 comments on commit b5b4ad3

Please sign in to comment.