diff options
author | Simon Rettberg | 2017-12-05 16:20:04 +0100 |
---|---|---|
committer | Simon Rettberg | 2017-12-05 16:20:04 +0100 |
commit | 66ed48b68d0d8d534fc0d28c2ad0426645903db9 (patch) | |
tree | f9fecc4320223c7b846a3ee66dff128667f16413 | |
parent | [netshare] add warning for unencrypted password (diff) | |
download | tutor-module-66ed48b68d0d8d534fc0d28c2ad0426645903db9.tar.gz tutor-module-66ed48b68d0d8d534fc0d28c2ad0426645903db9.tar.xz tutor-module-66ed48b68d0d8d534fc0d28c2ad0426645903db9.zip |
[server] Fix NPE if no existing config in DB
-rw-r--r-- | dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/RuntimeConfig.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/RuntimeConfig.java b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/RuntimeConfig.java index ea3c7ae0..df0349fa 100644 --- a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/RuntimeConfig.java +++ b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/RuntimeConfig.java @@ -16,12 +16,14 @@ public class RuntimeConfig { @Override protected SatelliteConfig update() { - SatelliteConfig satConfig, readConfig; + SatelliteConfig satConfig = null, readConfig = null; try { readConfig = DbConfiguration.getSatelliteConfig(); - satConfig = readConfig.deepCopy(); } catch (SQLException e) { - readConfig = satConfig = null; + // Fall through + } + if (readConfig != null) { + satConfig = readConfig.deepCopy(); } if (satConfig == null) { satConfig = new SatelliteConfig(); |