diff --git a/src/main/java/cz/cvut/kbss/study/rest/PatientRecordController.java b/src/main/java/cz/cvut/kbss/study/rest/PatientRecordController.java index 7f4a512c..987c4b56 100644 --- a/src/main/java/cz/cvut/kbss/study/rest/PatientRecordController.java +++ b/src/main/java/cz/cvut/kbss/study/rest/PatientRecordController.java @@ -184,7 +184,10 @@ public void updateRecord(@PathVariable("key") String key, @RequestBody PatientRe private void onUpdateRecord(URI uri){ Objects.nonNull(uri); - String onRecordUpdateServiceUrl = configReader.getConfig(ConfigParam.ON_UPDATE_RECORD_SERVICE_URL); + String onRecordUpdateServiceUrl = Optional.ofNullable(configReader) + .map(r -> r.getConfig(ConfigParam.ON_UPDATE_RECORD_SERVICE_URL)) + .orElse(null); + if(onRecordUpdateServiceUrl == null || onRecordUpdateServiceUrl.isBlank()) { LOG.debug("No onRecordUpdateServiceUrl service url provided, noop."); return;