diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2016-09-24 09:18:01 +1200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-24 09:18:01 +1200 |
commit | dc4e6d3e388dc0ba96b9e92a269aaf7e5cd3aa03 (patch) | |
tree | 11bafd9aaef1be61394aebc7d214caf55ff14ac6 /src/org/traccar | |
parent | 137fe973583486303deaaea592a3a5f58304fa26 (diff) | |
parent | 8ff8eca68f5fa5ed4f4ab8cca68682a5387abe32 (diff) | |
download | traccar-server-dc4e6d3e388dc0ba96b9e92a269aaf7e5cd3aa03.tar.gz traccar-server-dc4e6d3e388dc0ba96b9e92a269aaf7e5cd3aa03.tar.bz2 traccar-server-dc4e6d3e388dc0ba96b9e92a269aaf7e5cd3aa03.zip |
Merge pull request #2356 from dcbastos/no-config-given
Avoid NullPointerException when no config file
Diffstat (limited to 'src/org/traccar')
-rw-r--r-- | src/org/traccar/Context.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/org/traccar/Context.java b/src/org/traccar/Context.java index e983ab99e..5a3dca878 100644 --- a/src/org/traccar/Context.java +++ b/src/org/traccar/Context.java @@ -145,10 +145,12 @@ public final class Context { public static void init(String[] arguments) throws Exception { config = new Config(); - if (arguments.length > 0) { - config.load(arguments[0]); + if (arguments.length <= 0) { + throw new RuntimeException("Configuration file is not provided"); } + config.load(arguments[0]); + loggerEnabled = config.getBoolean("logger.enable"); if (loggerEnabled) { Log.setupLogger(config); |