From 41315a7b988c6cb5a92226f6d31da77f221da4d3 Mon Sep 17 00:00:00 2001 From: Andreas Schildbach Date: Wed, 21 Mar 2012 21:22:06 +0100 Subject: [PATCH] fixed NPE --- .../schildbach/pte/AbstractHafasProvider.java | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/enabler/src/de/schildbach/pte/AbstractHafasProvider.java b/enabler/src/de/schildbach/pte/AbstractHafasProvider.java index 4a3ed3a8..67beb4ef 100644 --- a/enabler/src/de/schildbach/pte/AbstractHafasProvider.java +++ b/enabler/src/de/schildbach/pte/AbstractHafasProvider.java @@ -877,21 +877,14 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider if (pp.getEventType() == XmlPullParser.TEXT) pp.nextTag(); + final String c = XmlPullUtil.test(pp, "ConResCtxt") ? XmlPullUtil.text(pp) : null; final Context context; - if (XmlPullUtil.test(pp, "ConResCtxt")) - { - final String c = XmlPullUtil.text(pp); - if (previousContext == null) - context = new Context(c, c, 0); - else if (later) - context = new Context(c, previousContext.earlierContext, previousContext.sequence + 1); - else - context = new Context(previousContext.laterContext, c, previousContext.sequence + 1); - } + if (previousContext == null) + context = new Context(c, c, 0); + else if (later) + context = new Context(c, previousContext.earlierContext, previousContext.sequence + 1); else - { - context = null; - } + context = new Context(previousContext.laterContext, c, previousContext.sequence + 1); XmlPullUtil.enter(pp, "ConnectionList");