Skip to content

Commit

Permalink
fix potential endless loop in lazyById
Browse files Browse the repository at this point in the history
  • Loading branch information
decadence authored Sep 18, 2023
1 parent f0d949b commit b85a238
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Illuminate/Database/Concerns/BuildsQueries.php
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,10 @@ protected function orderedLazyById($chunkSize = 1000, $column = null, $alias = n
}

$lastId = $results->last()->{$alias};

if ($lastId === null) {
throw new RuntimeException("The lazyById operation was aborted because the [{$alias}] column is not present in the query result.");
}
}
});
}
Expand Down

0 comments on commit b85a238

Please sign in to comment.