mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-01-14 15:53:36 +01:00
fixed possible NPE
This commit is contained in:
@@ -38,6 +38,7 @@ import java.util.Properties;
|
||||
* @author Jeremy Long
|
||||
*/
|
||||
public final class Settings {
|
||||
|
||||
/**
|
||||
* The logger.
|
||||
*/
|
||||
@@ -425,7 +426,6 @@ public final class Settings {
|
||||
}
|
||||
//</editor-fold>
|
||||
|
||||
|
||||
/**
|
||||
* Private constructor for the Settings class. This class loads the
|
||||
* properties files.
|
||||
@@ -974,7 +974,7 @@ public final class Settings {
|
||||
*/
|
||||
public static File getDataDirectory() throws IOException {
|
||||
final File path = Settings.getDataFile(Settings.KEYS.DATA_DIRECTORY);
|
||||
if (path.exists() || path.mkdirs()) {
|
||||
if (path != null && (path.exists() || path.mkdirs())) {
|
||||
return path;
|
||||
}
|
||||
throw new IOException(String.format("Unable to create the data directory '%s'", path.getAbsolutePath()));
|
||||
|
||||
Reference in New Issue
Block a user