Fix potential NPE in ModelJsonAdapter

This commit is contained in:
0xb00bface 2021-12-19 17:56:38 +01:00
parent f439d07229
commit 0d512134ed
1 changed files with 1 additions and 1 deletions

View File

@ -76,7 +76,7 @@ public class ModelJsonAdapter extends JsonAdapter<Model> {
try {
model.readSiteSpecificData(reader);
} catch (Exception e) {
LOG.error("Couldn't read site specific data for model {}", model.getName());
LOG.error("Couldn't read site specific data for model {}", Optional.ofNullable(model).map(Model::getName).orElse("n/a"));
throw e;
}
reader.endObject();