diff --git a/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/UploadFileDialog.java b/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/UploadFileDialog.java
index 80ae17a53d0..44675a33ede 100644
--- a/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/UploadFileDialog.java
+++ b/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/UploadFileDialog.java
@@ -228,6 +228,10 @@ private boolean setUpFolders() {
Folder mediaView = dataEditor.getProcess().getProject().getMediaView();
Folder preview = dataEditor.getProcess().getProject().getPreview();
+ if (Objects.isNull(sourceFolder) || Objects.isNull(mediaView) || Objects.isNull(preview)) {
+ return false;
+ }
+
sourceFolder.setPath(variableReplacer.replace(sourceFolder.getRelativePath()));
mediaView.setPath(variableReplacer.replace(mediaView.getRelativePath()));
preview.setPath(variableReplacer.replace(preview.getRelativePath()));
@@ -440,5 +444,17 @@ public void refresh() throws NoSuchMetadataFieldException {
}
}
+ /**
+ * Check and return whether folder configuration of current process' project is
+ * complete, e.g. allows upload and conversion of media files. This means folders for thumbnails,
+ * detail views and generator source have to be configured in the project configuration.
+ *
+ * @return whether project folder configuration is complete or not
+ */
+ public boolean isFolderConfigurationComplete() {
+ return Objects.nonNull(dataEditor.getProcess().getProject().getGeneratorSource())
+ && Objects.nonNull(dataEditor.getProcess().getProject().getMediaView())
+ && Objects.nonNull(dataEditor.getProcess().getProject().getPreview());
+ }
}
diff --git a/Kitodo/src/main/webapp/WEB-INF/templates/includes/metadataEditor/gallery.xhtml b/Kitodo/src/main/webapp/WEB-INF/templates/includes/metadataEditor/gallery.xhtml
index 77e9f886c39..9bb135a55c1 100644
--- a/Kitodo/src/main/webapp/WEB-INF/templates/includes/metadataEditor/gallery.xhtml
+++ b/Kitodo/src/main/webapp/WEB-INF/templates/includes/metadataEditor/gallery.xhtml
@@ -390,7 +390,7 @@
imagePreviewForm:mediaContextMenu"/>