Skip to content

Commit

Permalink
Update Model.php
Browse files Browse the repository at this point in the history
Fix TypeError error in the methods: doFind and doFirst when using casts
  • Loading branch information
avegacms authored and kenjis committed May 8, 2024
1 parent 5c05447 commit 4639608
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion system/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ protected function doFind(bool $singleton, $id = null)
$row = $builder->get()->getResult($this->tempReturnType);
}

if ($useCast) {
if ($useCast && $row !== null) {
$row = $this->convertToReturnType($row, $returnType);

$this->tempReturnType = $returnType;
Expand Down

0 comments on commit 4639608

Please sign in to comment.