Skip to content

Commit

Permalink
Merge pull request #72 from AR-TTUBEOG/feature/34
Browse files Browse the repository at this point in the history
[Fix] 페이징 예외 수정
  • Loading branch information
arinming authored Feb 17, 2024
2 parents 2f2fa9e + eb4056e commit 8ce8551
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public class PlaceService {

public List<GetAllPlaceRes> getPageOfPlaces(List<GetAllPlaceRes> places, int page, int size) {
int startIndex = page * size;
startIndex = Math.min(startIndex, places.size());
int endIndex = Math.min(startIndex + size, places.size());

return places.subList(startIndex, endIndex);
Expand Down

0 comments on commit 8ce8551

Please sign in to comment.