diff --git a/system/Entity.php b/system/Entity.php index b2fb64f2b8a5..eb257062b243 100644 --- a/system/Entity.php +++ b/system/Entity.php @@ -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)