added check for null

This commit is contained in:
Chumva 2018-03-05 15:27:09 +02:00
parent fa8fa3d900
commit 5704196700

View file

@ -59,11 +59,13 @@ public class TransportStopRouteAdapter extends ArrayAdapter<TransportStopRoute>
}
private String getAdjustedRouteRef(String ref) {
if (ref.contains(":")) {
ref = ref.substring(0, ref.lastIndexOf(':'));
}
if (ref.length() > 4) {
ref = ref.substring(0, 4);
if (ref != null) {
if (ref.contains(":")) {
ref = ref.substring(0, ref.lastIndexOf(':'));
}
if (ref.length() > 4) {
ref = ref.substring(0, 4);
}
}
return ref;
}