Skip to content

Commit 39bad03

Browse files
authored
fix potential endless loop in lazyById (#48436)
1 parent ca54689 commit 39bad03

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Illuminate/Database/Concerns/BuildsQueries.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,10 @@ protected function orderedLazyById($chunkSize = 1000, $column = null, $alias = n
281281
}
282282

283283
$lastId = $results->last()->{$alias};
284+
285+
if ($lastId === null) {
286+
throw new RuntimeException("The lazyById operation was aborted because the [{$alias}] column is not present in the query result.");
287+
}
284288
}
285289
});
286290
}

0 commit comments

Comments
 (0)