OpenTreeMap / otm-android

An OpenTreeMap client for Android. The OpenTreeMap code can be downloaded at https://github.com/OpenTreeMap/otm-core.
Other
23 stars 22 forks source link

Exception in Nearby List screen parsing plot ID #275

Open maurizi opened 8 years ago

maurizi commented 8 years ago

Error was reported by Rollbar. Stacktrace:

 org.json.JSONException: Value null at id of type org.json.JSONObject$1 cannot be converted to int
1 at org.json.JSON.typeMismatch (JSON.java:100)
2 at org.json.JSONObject.getInt (JSONObject.java:481)
3 at org.azavea.otm.data.Plot.getId (Plot.java:106)
4 at org.azavea.otm.data.PlotContainer.getAll (PlotContainer.java:16)
5 at org.azavea.lists.NearbyList.getDisplayValues (NearbyList.java:114)
6 at org.azavea.lists.NearbyList.getDisplayValues (NearbyList.java:26)
7 at org.azavea.otm.ui.ListDisplay.update (ListDisplay.java:132)
8 at org.azavea.lists.NearbyList.notifyObservers (NearbyList.java:171)
9 at org.azavea.lists.NearbyList.access$300 (NearbyList.java:26)
10 at org.azavea.lists.NearbyList$2.dataReceived (NearbyList.java:159)
11 at org.azavea.lists.NearbyList$2.dataReceived (NearbyList.java:155)
12 at org.azavea.otm.rest.handlers.ContainerRestHandler.onSuccess (ContainerRestHandler.java:17)
13 at com.loopj.android.http.JsonHttpResponseHandler$1$1.run (JsonHttpResponseHandler.java:127)

Since this block of code is wrapped in a try {} catch I don't think this is manifesting as a crash for the user - it probably just appears that this screen doesn't work.

It's unclear if this is a problem in the app or a problem in the API.