From 5a939ec108198be29f7127f425e9870b93fc5dd9 Mon Sep 17 00:00:00 2001 From: Stefan Neuhaus Date: Sat, 8 Oct 2016 20:00:43 +0200 Subject: [PATCH] Provide proper error message in case the (default) property file is not available. Ran into this issue in combination with the Gradle daemon. --- .../main/java/org/owasp/dependencycheck/utils/Settings.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dependency-check-utils/src/main/java/org/owasp/dependencycheck/utils/Settings.java b/dependency-check-utils/src/main/java/org/owasp/dependencycheck/utils/Settings.java index 359d24171..12b463e52 100644 --- a/dependency-check-utils/src/main/java/org/owasp/dependencycheck/utils/Settings.java +++ b/dependency-check-utils/src/main/java/org/owasp/dependencycheck/utils/Settings.java @@ -370,8 +370,11 @@ public final class Settings { try { in = this.getClass().getClassLoader().getResourceAsStream(propertiesFilePath); props.load(in); + } catch (NullPointerException ex) { + LOGGER.error("Did not find settings file '{}'.", propertiesFilePath); + LOGGER.debug("", ex); } catch (IOException ex) { - LOGGER.error("Unable to load default settings."); + LOGGER.error("Unable to load settings from '{}'.", propertiesFilePath); LOGGER.debug("", ex); } finally { if (in != null) {