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