From c0dfae1a39bf99a7005a10eed351f2f1757b303d Mon Sep 17 00:00:00 2001 From: "andreas.schildbach" Date: Fri, 29 Oct 2010 20:27:41 +0000 Subject: [PATCH] ignore unparsable serving lines git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@324 0924bc21-9374-b0fa-ee44-9ff1593b38f0 --- .../schildbach/pte/AbstractEfaProvider.java | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/de/schildbach/pte/AbstractEfaProvider.java b/src/de/schildbach/pte/AbstractEfaProvider.java index 081f952e..f7795917 100644 --- a/src/de/schildbach/pte/AbstractEfaProvider.java +++ b/src/de/schildbach/pte/AbstractEfaProvider.java @@ -688,12 +688,19 @@ public abstract class AbstractEfaProvider implements NetworkProvider XmlPullUtil.enter(pp); while (XmlPullUtil.test(pp, "itdServingLine")) { - final String line = parseLine(pp.getAttributeValue(null, "motType"), pp.getAttributeValue(null, "number"), pp - .getAttributeValue(null, "number")); - 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; - lines.add(new Line(line, lineColors(line), destinationId, destination)); + try + { + final String line = parseLine(pp.getAttributeValue(null, "motType"), pp.getAttributeValue(null, "number"), pp + .getAttributeValue(null, "number")); + 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; + lines.add(new Line(line, lineColors(line), destinationId, destination)); + } + catch (final IllegalArgumentException x) + { + // swallow for now + } XmlPullUtil.enter(pp); XmlPullUtil.exit(pp);