mirror of
https://github.com/whyorean/AuroraStore.git
synced 2026-06-19 13:08:59 -04:00
Fixed an NPE happening when the user tries to get empty review list
This commit is contained in:
@@ -46,7 +46,8 @@ public class ReviewStorageIterator extends ReviewIterator {
|
||||
}
|
||||
|
||||
private List<Review> current() {
|
||||
int offset = PAGE_SIZE * page;
|
||||
return list.subList(offset, offset + PAGE_SIZE);
|
||||
int from = PAGE_SIZE * page;
|
||||
int to = from + PAGE_SIZE;
|
||||
return (from < 0 || to > list.size()) ? new ArrayList<Review>() : list.subList(from, to);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user