mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-17 18:29:51 +00:00
fixed NPE
This commit is contained in:
parent
b7cbeff9de
commit
41315a7b98
1 changed files with 6 additions and 13 deletions
|
@ -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");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue