Skip to content

Commit

Permalink
Fix NullPointerException
Browse files Browse the repository at this point in the history
  • Loading branch information
matthias-ronge authored Mar 6, 2024
1 parent 023d949 commit df1e333
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ public List<Pair<PhysicalDivision, LogicalDivision>> getSelectedMedia() {
* <p>Note: This method is called potentially thousands of times when rendering large galleries.</p>
*/
public boolean consecutivePagesSelected() {
if (selectedMedia.isEmpty()) {
if (Objects.isNull(selectedMedia) || selectedMedia.isEmpty()) {
return false;
}
int maxOrder = selectedMedia.stream().mapToInt(m -> m.getLeft().getOrder()).max().orElseThrow(NoSuchElementException::new);
Expand Down

0 comments on commit df1e333

Please sign in to comment.