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 7d40db278e7..c39d5c30e6f 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); diff --git a/Kitodo/src/main/java/org/kitodo/production/metadata/MetadataEditor.java b/Kitodo/src/main/java/org/kitodo/production/metadata/MetadataEditor.java index 5856af657e9..4a5a33c5fbc 100644 --- a/Kitodo/src/main/java/org/kitodo/production/metadata/MetadataEditor.java +++ b/Kitodo/src/main/java/org/kitodo/production/metadata/MetadataEditor.java @@ -198,7 +198,7 @@ private static void addMultipleStructuresWithMetadataGroup(int number, String ty for (int i = 0; i < number; i++) { LogicalDivision newStructure = addLogicalDivision(type, workpiece, structure, position, Collections.emptyList()); - if (Objects.isNull(newStructure) || metadataKey.isEmpty() || metadataKey == null) { + if (Objects.isNull(newStructure) || metadataKey == null || metadataKey.isEmpty()) { continue; } MetadataGroup metadataGroup = new MetadataGroup(); diff --git a/Kitodo/src/main/java/org/kitodo/production/services/data/FilterService.java b/Kitodo/src/main/java/org/kitodo/production/services/data/FilterService.java index 7b3385a0d47..64a65d1c317 100644 --- a/Kitodo/src/main/java/org/kitodo/production/services/data/FilterService.java +++ b/Kitodo/src/main/java/org/kitodo/production/services/data/FilterService.java @@ -261,9 +261,9 @@ private QueryBuilder buildQueryFromCondition(String condition, ObjectType object } private String replaceLegacyFilters(String filter) { - filter.replace("processproperty","property"); - filter.replace("workpiece","property"); - filter.replace("template","property"); + filter = filter.replace("processproperty","property"); + filter = filter.replace("workpiece","property"); + filter = filter.replace("template","property"); return filter; }