aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-09-24 09:18:01 +1200
committerGitHub <noreply@github.com>2016-09-24 09:18:01 +1200
commitdc4e6d3e388dc0ba96b9e92a269aaf7e5cd3aa03 (patch)
tree11bafd9aaef1be61394aebc7d214caf55ff14ac6
parent137fe973583486303deaaea592a3a5f58304fa26 (diff)
parent8ff8eca68f5fa5ed4f4ab8cca68682a5387abe32 (diff)
downloadtrackermap-server-dc4e6d3e388dc0ba96b9e92a269aaf7e5cd3aa03.tar.gz
trackermap-server-dc4e6d3e388dc0ba96b9e92a269aaf7e5cd3aa03.tar.bz2
trackermap-server-dc4e6d3e388dc0ba96b9e92a269aaf7e5cd3aa03.zip
Merge pull request #2356 from dcbastos/no-config-given
Avoid NullPointerException when no config file
-rw-r--r--src/org/traccar/Context.java6
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);