title: NullPointerException on GSON Parsing
body: <p>I use GSON to parse JSON data, and my app is currently able to parse Google Geocoder with this. But, whenever I try to parse JSON from another website it gives nullpointerexception</p>
  
  <p>This is my EventResponse Class which makes the connection btw GSON and <a href="http://etrafimdakietkinlikler.herokuapp.com/api/v1/event/?format=json" rel="nofollow">website</a></p>
  
  <pre><code>public class EventResponse {
      public Meta meta;
      public Objects[] Objects;
  
      public EventResponse() {}
  
      public class Meta {
          public int limit;
          public String next;
          public int offset;
          public String previous;
          public int total_count;
      }
  
      public class Objects {
          public String category;
          public String date;
          public String description;
          public int id;
          public String name;
          public String resource_uri;
          public String venue;
      }
  }
  </code></pre>
  
  <p>This is the JSON</p>
  
  <pre><code>{
      "meta": {
          "limit": 20,
          "next": null,
          "offset": 0,
          "previous": null,
          "total_count": 7
      },
      "objects": [
          {
              "category": "/api/v1/category/1/",
              "date": "2013-05-01",
              "description": "BeÅŸ yakÄ±n arkadaÅŸ, ", //Description is longer in real
              "id": 10,
              "name": "KÃ¶tÃ¼ Ruh / Evil Dead",
              "resource_uri": "/api/v1/event/10/",
              "venue": "/api/v1/venue/3/"
          },
          {
              "category": "/api/v1/category/1/",
              "date": "2013-05-02",
              "description": "Filmde, kÃ¼Ã§Ã¼mseyen, ",
              "id": 9,
              "name": "KorkunÃ§ Bir Film 5 / Scary Movie 5",
              "resource_uri": "/api/v1/event/9/",
              "venue": "/api/v1/venue/6/"
          }
      ]
  }
  </code></pre>
  
  <p>This is how I use GSON (I tried Objects[0] also, it didn't matter)</p>
  
  <pre><code>Gson gson = new Gson();
          EventResponse eResult = new EventResponse();
          try {
              eResult = gson.fromJson(jsonCoord((catURL + Categories.catID)),
                      EventResponse.class);
  
              Log.i("ama"+eResult.Objects[1].category, "deneme");
  </code></pre>
  
  <p>jsonCoord method</p>
  
  <pre><code>public String jsonCoord(String address) throws IOException {
          URL url = new URL(address);
          URLConnection connection = url.openConnection();
          BufferedReader in = new BufferedReader(new InputStreamReader(
                  connection.getInputStream()));
          String inputLine;
          String jsonResult = "";
          while ((inputLine = in.readLine()) != null) {
              jsonResult += inputLine;
          }
          in.close();
          return jsonResult;
      }
  </code></pre>
  
  <p>and I cannot get any value even from the Log. The error stack is like this: (line 59 is the log line)</p>
  
  <pre><code>05-02 21:48:32.020: W/System.err(17456): java.lang.NullPointerException
  05-02 21:48:32.030: W/System.err(17456):    at com.myapp.myapp.Events.getVenue(Events.java:59)
  05-02 21:48:32.030: W/System.err(17456):    at com.myapp.myapp.Events.onCreate(Events.java:48)
  05-02 21:48:32.030: W/System.err(17456):    at android.app.Activity.performCreate(Activity.java:5206)
  05-02 21:48:32.030: W/System.err(17456):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1083)
  05-02 21:48:32.030: W/System.err(17456):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2064)
  05-02 21:48:32.030: W/System.err(17456):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2125)
  05-02 21:48:32.030: W/System.err(17456):    at android.app.ActivityThread.access$600(ActivityThread.java:140)
  05-02 21:48:32.030: W/System.err(17456):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1227)
  05-02 21:48:32.030: W/System.err(17456):    at android.os.Handler.dispatchMessage(Handler.java:99)
  05-02 21:48:32.030: W/System.err(17456):    at android.os.Looper.loop(Looper.java:137)
  05-02 21:48:32.030: W/System.err(17456):    at android.app.ActivityThread.main(ActivityThread.java:4898)
  05-02 21:48:32.030: W/System.err(17456):    at java.lang.reflect.Method.invokeNative(Native Method)
  05-02 21:48:32.030: W/System.err(17456):    at java.lang.reflect.Method.invoke(Method.java:511)
  05-02 21:48:32.030: W/System.err(17456):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1006)
  05-02 21:48:32.035: W/System.err(17456):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773)
  05-02 21:48:32.035: W/System.err(17456):    at dalvik.system.NativeStart.main(Native Method)
  </code></pre>