aboutsummaryrefslogtreecommitdiff
path: root/src/net/cbaines/suma/DataManager.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/cbaines/suma/DataManager.java')
-rw-r--r--src/net/cbaines/suma/DataManager.java13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/net/cbaines/suma/DataManager.java b/src/net/cbaines/suma/DataManager.java
index 4959865..9ccc8f0 100644
--- a/src/net/cbaines/suma/DataManager.java
+++ b/src/net/cbaines/suma/DataManager.java
@@ -546,7 +546,12 @@ public class DataManager {
PreparedQuery<RouteStops> routeStopsPreparedQuery = routeStopsQueryBuilder.prepare();
List<RouteStops> routeStops = routeStopsDao.query(routeStopsPreparedQuery);
- Log.i(TAG, "Found " + routeStops.size() + " stops matching the destStop " + destStop + " on route " + route.code);
+ if (routeStops.size() > 0) {
+ Log.i(TAG, "Found " + routeStops.size() + " stops matching the destStop " + destStop + " on route " + route.code);
+ } else {
+ Log.e(TAG, "Found " + routeStops.size() + " stops matching the destStop " + destStop + " on route " + route.code);
+ return null;
+ }
Date now = new Date(System.currentTimeMillis());
@@ -847,16 +852,16 @@ public class DataManager {
for (int busStop = 0; busStop < routeStops.size() && busStop >= 0; busStop = busStop + moveAmount) {
// if (routeStops.get(busStop).stop.equals(startBusStop))
// continue;
- startBusStop = routeStops.get(busStop).stop;
+ startBusStop = routeStops.get(busStop).busStop;
busStopDao.refresh(startBusStop);
BusStop predictedNextStop = busRoute.moveInRoute(context, startBusStop, direction, moveAmount);
BusStop nextStop;
if (busStop == routeStops.size() - 1) {
- nextStop = routeStops.get(0).stop;
+ nextStop = routeStops.get(0).busStop;
} else {
- nextStop = routeStops.get(busStop + 1).stop;
+ nextStop = routeStops.get(busStop + 1).busStop;
}
busStopDao.refresh(nextStop);