diff --git a/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/DataEditorForm.java b/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/DataEditorForm.java index f933e656756..1c2c22b4c53 100644 --- a/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/DataEditorForm.java +++ b/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/DataEditorForm.java @@ -757,7 +757,7 @@ public List> getSelectedMedia() { *

Note: This method is called potentially thousands of times when rendering large galleries.

*/ 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);