title: java.lang.NullPointerException error with JSONObject
body: <p>I got a java.lang.NullPointerException  on this line <code>pdao.majPost(c);</code> when I try to grab my posts from my API and trying to insert post my SQLite database.</p>
  
  <p>My JSON Parser Class:</p>
  
  <pre><code>private PostsDAO pdao;
  
  public void data() {
  
      AsyncHttpClient client = new AsyncHttpClient();
      client.get("http://twitter.192.168.1.38.xip.io/api/v1/posts", new AsyncHttpResponseHandler() {
          @Override
          public void onSuccess(String response) {
  
              JSONObject data;
              JSONArray posts;
              try {
                  data = new JSONObject(response);
  
                  // Traitement des posts
                  posts = data.getJSONArray("posts");
                  for (int i = 0; i &lt; posts.length(); i++) {
                      JSONObject c = posts.getJSONObject(i);
                      pdao.majPost(c);
                  }
  
              } catch (JSONException e) {
                  // TODO Auto-generated catch block
                  e.printStackTrace();
              }
  
          }
      });
  
  }
  </code></pre>
  
  <p>My PostDAO file</p>
  
  <pre><code>public void majPost(JSONObject c) throws JSONException {
      ContentValues values = new ContentValues();
      values.put("id_post", c.getInt("id_post"));
      values.put("id_user", c.getInt("id_user"));
      values.put("content", c.getString("content"));
      values.put("photo", c.getString("photo"));
      values.put("masked", c.getInt("masked"));
      values.put("deleted", c.getInt("deleted"));
      values.put("created_at", c.getString("created_at"));
      values.put("updated_at", c.getString("updated_at"));
      db.insert("posts", null, values);
  }
  </code></pre>