Skip to content

Commit

Permalink
Fix #628 - Add null check for stopId
Browse files Browse the repository at this point in the history
  • Loading branch information
barbeau committed Jul 25, 2016
1 parent c6dadac commit 3924cb7
Showing 1 changed file with 15 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,18 @@
*/
package org.onebusaway.android.ui;

import org.onebusaway.android.R;
import org.onebusaway.android.io.ObaApi;
import org.onebusaway.android.io.elements.ObaReferences;
import org.onebusaway.android.io.elements.ObaRoute;
import org.onebusaway.android.io.elements.ObaStop;
import org.onebusaway.android.io.elements.ObaTrip;
import org.onebusaway.android.io.elements.ObaTripSchedule;
import org.onebusaway.android.io.elements.ObaTripStatus;
import org.onebusaway.android.io.request.ObaTripDetailsRequest;
import org.onebusaway.android.io.request.ObaTripDetailsResponse;
import org.onebusaway.android.util.UIUtils;

import android.content.Context;
import android.content.Intent;
import android.graphics.drawable.GradientDrawable;
Expand All @@ -39,18 +51,6 @@
import android.widget.ListView;
import android.widget.TextView;

import org.onebusaway.android.R;
import org.onebusaway.android.io.ObaApi;
import org.onebusaway.android.io.elements.ObaReferences;
import org.onebusaway.android.io.elements.ObaRoute;
import org.onebusaway.android.io.elements.ObaStop;
import org.onebusaway.android.io.elements.ObaTrip;
import org.onebusaway.android.io.elements.ObaTripSchedule;
import org.onebusaway.android.io.elements.ObaTripStatus;
import org.onebusaway.android.io.request.ObaTripDetailsRequest;
import org.onebusaway.android.io.request.ObaTripDetailsResponse;
import org.onebusaway.android.util.UIUtils;

import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.concurrent.TimeUnit;
Expand Down Expand Up @@ -357,6 +357,9 @@ private void setUpHeader() {
}

private Integer findIndexForStop(ObaTripSchedule.StopTime[] stopTimes, String stopId) {
if (stopId == null) {
return null;
}
for (int i = 0; i < stopTimes.length; i++) {
if (stopId.equals(stopTimes[i].getStopId())) {
return i;
Expand Down

0 comments on commit 3924cb7

Please sign in to comment.