[Users | Trunk]: Fix exception when a user is not yer registered to openaire
This commit is contained in:
parent
230284002e
commit
c7e62e2734
|
@ -62,7 +62,13 @@ public class RegistryCalls {
|
|||
params.put("coid", coid);
|
||||
params.put("mail", email);
|
||||
JsonElement response = httpUtils.get("co_people.json", params);
|
||||
return (response != null) ? response.getAsJsonObject().get("CoPeople").getAsJsonArray().get(0).getAsJsonObject().get("Id").getAsInt() : null;
|
||||
if(response != null) {
|
||||
JsonArray coPeople = response.getAsJsonObject().get("CoPeople").getAsJsonArray();
|
||||
if(coPeople.size() > 0) {
|
||||
return coPeople.get(0).getAsJsonObject().get("Id").getAsInt();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue