diff --git a/src/main/java/de/samply/query/QueryService.java b/src/main/java/de/samply/query/QueryService.java index e000005..be0baa2 100644 --- a/src/main/java/de/samply/query/QueryService.java +++ b/src/main/java/de/samply/query/QueryService.java @@ -57,7 +57,7 @@ public String createQuery( tempQuery.setDescription(description); tempQuery.setOutputFormat(outputFormat); tempQuery.setTemplateId(templateId); - tempQuery.setHumanReadable(Base64Utils.decode(humanReadable)); + tempQuery.setHumanReadable(Base64Utils.decodeIfNecessary(humanReadable)); tempQuery.setExplorerUrl(decodeUrlIfNecessary(explorerUrl)); tempQuery.setContext(queryContext); tempQuery = this.queryRepository.save(tempQuery); @@ -115,7 +115,7 @@ public void editQuery(@NotNull String projectCode, changedKeyValueMap.put("template id", templateId); } if (humanReadable != null) { - projectQuery.setHumanReadable(Base64Utils.decode(humanReadable)); + projectQuery.setHumanReadable(Base64Utils.decodeIfNecessary(humanReadable)); changedKeyValueMap.put("human readable", humanReadable); } if (explorerUrl != null) {