From 9ee957241f700663861575b7dc1be8020594fe09 Mon Sep 17 00:00:00 2001 From: Matthias Ronge Date: Fri, 2 Aug 2024 10:10:29 +0200 Subject: [PATCH 1/2] Fix NullPointerException if ruleset could not be loaded --- .../production/forms/createprocess/AddMetadataDialog.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Kitodo/src/main/java/org/kitodo/production/forms/createprocess/AddMetadataDialog.java b/Kitodo/src/main/java/org/kitodo/production/forms/createprocess/AddMetadataDialog.java index ce1f46343bc..eea7ed07bcd 100644 --- a/Kitodo/src/main/java/org/kitodo/production/forms/createprocess/AddMetadataDialog.java +++ b/Kitodo/src/main/java/org/kitodo/production/forms/createprocess/AddMetadataDialog.java @@ -64,6 +64,9 @@ public List getAddableMetadata() { * @return whether any further metadata can be added to currently selected structure element. */ public boolean metadataAddableToStructureElement() throws InvalidMetadataValueException { + if (Objects.isNull(createProcessForm.getRulesetManagement())) { + return false; + } prepareAddableMetadataForStructure(); return !getAddableMetadata().isEmpty(); } From ea47736025c0c96f48a6bcea4328ac66160a6fc0 Mon Sep 17 00:00:00 2001 From: Matthias Ronge Date: Tue, 13 Aug 2024 17:04:30 +0200 Subject: [PATCH 2/2] import java.util.Objects --- .../kitodo/production/forms/createprocess/AddMetadataDialog.java | 1 + 1 file changed, 1 insertion(+) diff --git a/Kitodo/src/main/java/org/kitodo/production/forms/createprocess/AddMetadataDialog.java b/Kitodo/src/main/java/org/kitodo/production/forms/createprocess/AddMetadataDialog.java index eea7ed07bcd..be98b0c9c38 100644 --- a/Kitodo/src/main/java/org/kitodo/production/forms/createprocess/AddMetadataDialog.java +++ b/Kitodo/src/main/java/org/kitodo/production/forms/createprocess/AddMetadataDialog.java @@ -12,6 +12,7 @@ package org.kitodo.production.forms.createprocess; import java.util.List; +import java.util.Objects; import javax.faces.model.SelectItem;