title: null pointer exception java accessing nested json object using maven group org.json
body: <p>this is my depedency </p>
  
  <pre><code> &lt;dependency&gt;
      &lt;groupId&gt;org.json&lt;/groupId&gt;
      &lt;artifactId&gt;json&lt;/artifactId&gt;
    &lt;version&gt;20160810&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>this is my json object</p>
  
  <pre><code>{
     "authorize": {
         "balance": "9984.06",
         "country": "id",
         "currency": "USD",
         "email": "xxxx.xxxx@gmail.com",
         "fullname": "  ",
         "is_virtual": 1,
         "landing_company_fullname": "Binary Ltd",
         "landing_company_name": "virtual",
         "loginid": "VRg4423",
         "scopes": [
           "read",
           "trade"
         ]
     }
  }
  </code></pre>
  
  <p>this is my code</p>
  
  <pre><code>JSONObject jsonObject = new JSONObject(fil);
  JSONObject jsonChildObject = (JSONObject) jsonObject.get("authorize");
  Iterator iterator  = jsonChildObject.keys();
  String key = null;
  while (iterator.hasNext()) {
      key = (String) iterator.next();
      System.out.println("balance value:" + ((JSONObject) jsonChildObject.get(key)).get("balance"));
  }
  </code></pre>
  
  <p>I have no idea why I can't acces all the child node value. It returns null pointer exception there is no "authorize" i can't get the parent value.</p>