Check for null address, and added email

pull/105/merge
Stephen Moore 2012-05-23 13:35:05 -04:00
parent 9b03831d4e
commit 9612fde10e
1 changed files with 12 additions and 10 deletions

View File

@ -74,6 +74,7 @@ public class JSONUserInfoView extends AbstractView{
obj.addProperty("family_name", ui.getFamilyName());
obj.addProperty("middle_name", ui.getMiddleName());
obj.addProperty("nickname", ui.getNickname());
obj.addProperty("email", ui.getEmail());
obj.addProperty("profile", ui.getProfile());
obj.addProperty("picture", ui.getPicture());
obj.addProperty("website", ui.getWebsite());
@ -84,6 +85,7 @@ public class JSONUserInfoView extends AbstractView{
obj.addProperty("phone_number", ui.getPhoneNumber());
obj.addProperty("updated_time", ui.getUpdatedTime());
if(ui.getAddress() != null) {
JsonObject addr = new JsonObject();
addr.addProperty("formatted", ui.getAddress().getFormatted());
addr.addProperty("street_address", ui.getAddress().getStreetAddress());
@ -93,7 +95,7 @@ public class JSONUserInfoView extends AbstractView{
addr.addProperty("country", ui.getAddress().getCountry());
obj.add("address", addr);
}
return obj;
}