title: How to handle null response for json object
body: <p>I get a JSON response as</p>
  
  <pre><code>{
  "edges": [],
  "nodes": []
  }
  </code></pre>
  
  <p>how to check if the objects has null values and handle the case??</p>
  
  <pre><code>JSONObject jobj = new JSONObject(line);
  JSONArray jArray = jobj.getJSONArray("edges");
  if(jArray.length()!=0)
  {    
    for(int i=0;i&lt;jArray.length();i++){
    JSONObject json_data = jArray.getJSONObject(i);
    x.add((float) json_data.getInt("x"));
    y.add((float) json_data.getInt("y"));
  end
  </code></pre>
  
  <p>This retrurns me : org.json.JSONException: end of input at character 0 of</p>