Skip to content

Commit

Permalink
Merge pull request #58 from TheTransitClock/MBTA_test
Browse files Browse the repository at this point in the history
Fix JSON exception in case where route_id not there.
  • Loading branch information
scrudden authored Jun 9, 2018
2 parents 27aa62a + d904a58 commit bf8d81d
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ protected Collection<AvlReport> processData(InputStream in) throws Exception {
JSONObject vehiclePosition=vehicle.getJSONObject("position");
JSONObject vehicleTrip=vehicle.getJSONObject("trip");

if(vehicleTrip.getString("route_id")!=null && (mbtaTestRoute==null || vehicleTrip.getString("route_id").equals(mbtaTestRoute.getValue())))
if(vehicleTrip.has("route_id") && (mbtaTestRoute==null || vehicleTrip.getString("route_id").equals(mbtaTestRoute.getValue())))
{
String blockid=vehicle.getString("block_id");
long timestamp=vehicle.getLong("timestamp");
Expand Down

0 comments on commit bf8d81d

Please sign in to comment.