Skip to content

Commit 4639608

Browse files
avegacmskenjis
authored andcommitted
Update Model.php
Fix TypeError error in the methods: doFind and doFirst when using casts
1 parent 5c05447 commit 4639608

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

system/Model.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ protected function doFind(bool $singleton, $id = null)
210210
$row = $builder->get()->getResult($this->tempReturnType);
211211
}
212212

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

216216
$this->tempReturnType = $returnType;

0 commit comments

Comments
 (0)