diff --git a/Kitodo/src/main/java/org/kitodo/production/forms/WorkflowForm.java b/Kitodo/src/main/java/org/kitodo/production/forms/WorkflowForm.java index 3fdb5ea6c6f..dcc45c1c890 100644 --- a/Kitodo/src/main/java/org/kitodo/production/forms/WorkflowForm.java +++ b/Kitodo/src/main/java/org/kitodo/production/forms/WorkflowForm.java @@ -270,8 +270,10 @@ private boolean saveFiles() throws IOException, WorkflowException { xmlDiagram = requestParameterMap.get("editForm:workflowTabView:xmlDiagram"); if (Objects.nonNull(xmlDiagram)) { - svgDiagram = StringUtils.substringAfter(xmlDiagram, "kitodo-diagram-separator"); - xmlDiagram = StringUtils.substringBefore(xmlDiagram, "kitodo-diagram-separator"); + if (xmlDiagram.contains("kitodo-diagram-separator")) { + svgDiagram = StringUtils.substringAfter(xmlDiagram, "kitodo-diagram-separator"); + xmlDiagram = StringUtils.substringBefore(xmlDiagram, "kitodo-diagram-separator"); + } Reader reader = new Reader(new ByteArrayInputStream(xmlDiagram.getBytes(StandardCharsets.UTF_8))); reader.validateWorkflowTasks();