Skip to content

Commit

Permalink
Merge pull request #5994 from matthias-ronge/patch-94
Browse files Browse the repository at this point in the history
Fix NullPointerException
  • Loading branch information
solth authored Apr 9, 2024
2 parents 5be1123 + df1e333 commit 426e553
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 426e553

Please sign in to comment.