File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -226,7 +226,7 @@ protected function addRelated($rows): ?array
226226 if (self ::$ schema ->tables ->{$ this ->table }->relations ->{$ tableName }->singleton )
227227 {
228228 $ key = singular ($ tableName );
229- $ object = reset ($ related [$ id ]) ?? null ;
229+ $ object = empty ($ related [$ id ]) ? null : reset ( $ related [ $ id ]) ;
230230 $ item [$ key ] = $ object ;
231231 }
232232 else
@@ -247,7 +247,7 @@ protected function addRelated($rows): ?array
247247 if (self ::$ schema ->tables ->{$ this ->table }->relations ->{$ tableName }->singleton )
248248 {
249249 $ property = singular ($ tableName );
250- $ object = reset ($ related [$ id ]) ?? null ;
250+ $ object = empty ($ related [$ id ]) ? null : reset ( $ related [ $ id ]) ;
251251 $ item ->$ property = $ object ;
252252 }
253253 else
You can’t perform that action at this time.
0 commit comments