Skip to content

Commit

Permalink
fix: add null check
Browse files Browse the repository at this point in the history
Should not pass null to Cash handlers.
  • Loading branch information
kenjis committed Sep 30, 2023
1 parent 2242fd1 commit 90f84ae
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions system/Entity/Entity.php
Original file line number Diff line number Diff line change
Expand Up @@ -402,14 +402,18 @@ protected function mapProperty(string $key)
* Converts the given string|timestamp|DateTime|Time instance
* into the "CodeIgniter\I18n\Time" object.
*
* @param DateTime|float|int|string|Time $value
* @param DateTime|float|int|string|Time|null $value
*
* @return Time
* @return Time|null
*
* @throws Exception
*/
protected function mutateDate($value)
{
if ($value === null) {
return null;
}

return DatetimeCast::set($value);
}

Expand Down

0 comments on commit 90f84ae

Please sign in to comment.