Add null check on the Organisation fromMap mapper

This commit is contained in:
George Kalampokis 2020-10-26 18:03:07 +02:00
parent 5b78943131
commit 8c2ae8cf46
1 changed files with 9 additions and 7 deletions

View File

@ -99,13 +99,15 @@ public class Organisation implements DataModel<eu.eudat.data.entities.Organisati
public static Organisation fromMap(HashMap<String, Object> map) {
Organisation model = new Organisation();
model.id = (String) map.get("id");
model.key = (String) map.get("key");
model.label = (String) map.get("label");
model.name = (String) map.get("name");
model.reference = (String) map.get("reference");
model.status = (int) map.get("status");
model.tag = (String) map.get("tag");
if (map != null) {
model.id = (String) map.get("id");
model.key = (String) map.get("key");
model.label = (String) map.get("label");
model.name = (String) map.get("name");
model.reference = (String) map.get("reference");
model.status = (int) map.get("status");
model.tag = (String) map.get("tag");
}
return model;
}