This commit is contained in:
Victor Shcherb 2020-05-17 14:40:04 +02:00
parent 36ae49de65
commit 9a7fcbd7b8
2 changed files with 4 additions and 3 deletions

View file

@ -1012,8 +1012,7 @@ public class RouteDataObject {
}
public boolean hasNameTagStartsWith(String tagStartsWith) {
int[] nextSegmentNameIds = nameIds;
for (int nm = 0; nm < nameIds.length; nm++) {
for (int nm = 0; nameIds != null && nm < nameIds.length; nm++) {
RouteTypeRule rtr = region.quickGetEncodingRule(nameIds[nm]);
if (rtr != null && rtr.getTag().startsWith(tagStartsWith)) {
return true;

View file

@ -359,7 +359,7 @@ public class RouteProvider {
insertInitialSegment(params, locs, directions, true);
res = new RouteCalculationResult(locs, directions, params, null, true);
} catch (RuntimeException e) {
e.printStackTrace();
log.error(e.getMessage(), e);
}
return res;
}
@ -815,8 +815,10 @@ public class RouteProvider {
return res;
}
} catch (RuntimeException e) {
log.error("Runtime error: " + e.getMessage(), e);
return new RouteCalculationResult(e.getMessage() );
} catch (InterruptedException e) {
log.error("Interrupted: " + e.getMessage(), e);
return interrupted();
} catch (OutOfMemoryError e) {
// ActivityManager activityManager = (ActivityManager)app.getSystemService(Context.ACTIVITY_SERVICE);