Skip to content

Commit 9c05a63

Browse files
committed
fix: add null check
Should not pass null to Cash handlers.
1 parent af395b6 commit 9c05a63

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

system/Entity/Entity.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,14 +402,18 @@ protected function mapProperty(string $key)
402402
* Converts the given string|timestamp|DateTime|Time instance
403403
* into the "CodeIgniter\I18n\Time" object.
404404
*
405-
* @param DateTime|float|int|string|Time $value
405+
* @param DateTime|float|int|string|Time|null $value
406406
*
407-
* @return Time
407+
* @return Time|null
408408
*
409409
* @throws Exception
410410
*/
411411
protected function mutateDate($value)
412412
{
413+
if ($value === null) {
414+
return null;
415+
}
416+
413417
return DatetimeCast::set($value);
414418
}
415419

0 commit comments

Comments
 (0)