title: Error org.json.JSONException: Index 2 out of range
body: <p>Hello My simple Json is and i have error org.json.JSONException: Index 2 out of range can you help me to solve this problem ?  :</p>
  
  <pre><code>[
  {
      "cat_id": 593,
      "title": "آلرژی و ایمونولوژی",
      "sub_cat": [
          {
              "cat_id": 594,
              "cat_title": "متخصص",
              "cat_parent_fk": 593
          },
          {
              "cat_id": 595,
              "cat_title": "فوق تخصص",
              "cat_parent_fk": 593
          }
      ]
  </code></pre>
  
  <p>and get this json with this code but i have some error and just show two item of my json >15 item :</p>
  
  <pre><code>JsonArrayRequest jsonArrayRequest = new JsonArrayRequest(Request.Method.GET, url, null, new Response.Listener&lt;JSONArray&gt;() {
          @Override
          public void onResponse(JSONArray response) {
              for (int i = 0; i &lt; response.length(); i++) {
                  try {
                      Cats cats = new Cats();
                      JSONObject jsonObject = (JSONObject) response.get(i);
                      String cat_id = jsonObject.getString("cat_id");
                      String title = jsonObject.getString("title");
                      String image_add = jsonObject.getString("image_add");
                      String image = jsonObject.getString("image");
  
                     JSONArray jsonArray = jsonObject.getJSONArray("sub_cat");
  
  
                      for (int j = 0; j &lt; jsonArray.length(); j++) {
                          JSONObject object = jsonArray.getJSONObject(i);
                          int sub_cat_id = object.getInt("cat_id");
                          String sub_cat_title = object.getString("cat_title");
                          int sub_parent_fk = object.getInt("cat_parent_fk");
                          Log.i("log", "onResponse: "+ sub_cat_id + sub_cat_title + sub_parent_fk);
                      }
  
  
                      cats.setCat_id(cat_id);
                      cats.setTitle(title);
                      cats.setImage(image);
                      cats.setImage_add(image_add);
                      list.add(cats);
                      catsAdapter.notifyDataSetChanged();
                  } catch (JSONException e) {
                      e.printStackTrace();
                  }
              }
  </code></pre>