title: JSON object with empty fields
body: <p>I'm getting a list of venues from foursquare and I need the name, the address and the city of each venue that I get. Here my problem is if address or city is empty, it gives an error and says " JSON Exception: No value for address". I tried different ways to fix it but couldn't solve the problem. I hope you can help me. Thank you.</p>
  
  <pre><code>JSONObject b = venues.getJSONObject(i);
  JSONObject location = b.getJSONObject("location");
  
  String name = "";
  String address = "";
  String city = "";
  
  if ("".equals(b.get("name"))) {
      //  Toast.makeText(Activity2.this,"Name of Place: " +name+ " Location: "+country, Toast.LENGTH_SHORT).show();
      name = "No place ";
  } else {
      name = b.getString("name");
  }
  
  if ("".equals(location.getString("address"))) {
      address = "No address";
  } else {
      address = location.getString("address");
  }
  
  if ("".equals(location.getString("city"))) {
      city = "No city";
  } else {
      city = location.getString("city");
  }
  
  name = "Name of the place: " + name; 
  // + " Address: "+ address + "  City: " + city;
  list.add(name);
  </code></pre>