fixes coverity CID 169315

This commit is contained in:
Sebastian Stenzel
2017-05-12 16:02:55 +02:00
parent 67a7dcdc4b
commit b53da45a15

View File

@@ -97,6 +97,9 @@ public class SettingsProvider implements Provider<Settings> {
try (InputStream in = Files.newInputStream(settingsPath, StandardOpenOption.READ); //
Reader reader = new InputStreamReader(in, StandardCharsets.UTF_8)) {
settings = gson.fromJson(reader, Settings.class);
if (settings == null) {
throw new IOException("Unexpected EOF");
}
LOG.info("Settings loaded from " + settingsPath);
} catch (IOException e) {
LOG.info("Failed to load settings, creating new one.");