Clear 'potential null pointer access' warnings.

This commit is contained in:
Andreas Schildbach 2015-02-05 16:28:59 +01:00
parent 5f8fc199a4
commit 4c8f48931c
2 changed files with 9 additions and 4 deletions

View file

@ -1201,10 +1201,10 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
XmlPullUtil.skipExit(pp, "Arrival");
// remove last intermediate
final int size = intermediateStops != null ? intermediateStops.size() : 0;
if (size >= 1)
if (!intermediateStops.get(size - 1).location.id.equals(sectionArrivalLocation.id))
intermediateStops.remove(size - 1);
if (intermediateStops != null)
if (!intermediateStops.isEmpty())
if (!intermediateStops.get(intermediateStops.size() - 1).location.id.equals(sectionArrivalLocation.id))
intermediateStops.remove(intermediateStops.size() - 1);
XmlPullUtil.skipExit(pp, "ConSection");