Skip to content

Commit

Permalink
Core - fixed optional ns config options
Browse files Browse the repository at this point in the history
* The new csvGenHeader and csvGenPlaceholder options should be optional.
However, the previous check was not working properly, and the whole
application would fail to start because of NullPointerExceptions.
  • Loading branch information
Vojtech-Sassmann committed Apr 1, 2021
1 parent c6b2e92 commit 43569ee
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public Map<String, NamespaceRules> loadSponsoredAccountsConfig() {

} catch(RuntimeException e) {
throw new InternalErrorException("Configuration file has invalid syntax. Configuration file: " +
configurationPath.getFilename());
configurationPath.getFilename(), e);
}

return namespacesRules;
Expand Down Expand Up @@ -69,9 +69,9 @@ private Set<NamespaceRules> loadNamespacesRulesFromJsonNode(JsonNode rootNode) {
namespaceRules.setDefaultEmail(defaultEmail.asText());
namespaceRules.setRequiredAttributes(requiredAttributes);
namespaceRules.setOptionalAttributes(optionalAttributes);
if (!csvGenHeader.isNull())
if (csvGenHeader != null && !csvGenHeader.isNull())
namespaceRules.setCsvGenHeader(csvGenHeader.asText());
if (!csvGenPlaceholder.isNull())
if (csvGenPlaceholder != null && !csvGenPlaceholder.isNull())
namespaceRules.setCsvGenPlaceholder(csvGenPlaceholder.asText());

rules.add(namespaceRules);
Expand Down

0 comments on commit 43569ee

Please sign in to comment.