Ensure that null map is also logged

This commit is contained in:
Armin Schrenk
2026-01-15 15:11:46 +01:00
parent 287ab4e792
commit 088b177c0e
@@ -95,9 +95,10 @@ class AdminPropertiesSetter {
private static Map<String, Object> loadAdminProperties(Path adminPropertiesPath) {
try (var in = Files.newInputStream(adminPropertiesPath, StandardOpenOption.READ)) {
var map = JSON.readValue(in, new TypeReference<Map<String, Object>>() {});
if (map != null) {
return map;
if (map == null) {
throw new NullPointerException("JSON parsing returned null");
}
return map;
} catch (NoSuchFileException _) {
//NO-OP
log("No admin properties found at {}.", List.of(adminPropertiesPath));