From 40cfcf50166ccda0d35e01e55806402e45eefd96 Mon Sep 17 00:00:00 2001 From: "andreas.schildbach@gmail.com" Date: Tue, 20 Dec 2011 16:35:40 +0000 Subject: [PATCH] fixed exception when destID is missing git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@860 0924bc21-9374-b0fa-ee44-9ff1593b38f0 --- src/de/schildbach/pte/AbstractEfaProvider.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/de/schildbach/pte/AbstractEfaProvider.java b/src/de/schildbach/pte/AbstractEfaProvider.java index 17fbc9fa..284c5fcf 100644 --- a/src/de/schildbach/pte/AbstractEfaProvider.java +++ b/src/de/schildbach/pte/AbstractEfaProvider.java @@ -1263,7 +1263,8 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider final int assignedStopId = assignedStopIdStr != null ? Integer.parseInt(assignedStopIdStr) : 0; final String destination = normalizeLocationName(pp.getAttributeValue(null, "direction")); final String destinationIdStr = pp.getAttributeValue(null, "destID"); - final int destinationId = destinationIdStr.length() > 0 ? Integer.parseInt(destinationIdStr) : 0; + final int destinationId = (destinationIdStr != null && destinationIdStr.length() > 0) ? Integer.parseInt(destinationIdStr) + : 0; final LineDestination line = new LineDestination(processItdServingLine(pp), destinationId, destination); @@ -1327,7 +1328,8 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider XmlPullUtil.require(pp, "itdServingLine"); final boolean isRealtime = pp.getAttributeValue(null, "realtime").equals("1"); final String destination = normalizeLocationName(pp.getAttributeValue(null, "direction")); - final int destinationId = Integer.parseInt(pp.getAttributeValue(null, "destID")); + final String destinationIdStr = pp.getAttributeValue(null, "destID"); + final int destinationId = destinationIdStr != null ? Integer.parseInt(destinationIdStr) : 0; final Line line = processItdServingLine(pp);