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