fixed exception when itdMessage is missing from itdDate

git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@861 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
andreas.schildbach@gmail.com 2011-12-20 16:42:20 +00:00
parent 40cfcf5016
commit 2b9900d216

View file

@ -1713,11 +1713,12 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
if (!pp.isEmptyElementTag())
{
XmlPullUtil.enter(pp, "itdDate");
if (!XmlPullUtil.test(pp, "itdMessage"))
throw new IllegalStateException("cannot find <itdMessage />");
final String message = pp.nextText();
if (message.equals("invalid date"))
return new QueryConnectionsResult(header, QueryConnectionsResult.Status.INVALID_DATE);
if (XmlPullUtil.test(pp, "itdMessage"))
{
final String message = pp.nextText();
if (message.equals("invalid date"))
return new QueryConnectionsResult(header, QueryConnectionsResult.Status.INVALID_DATE);
}
XmlPullUtil.exit(pp, "itdDate");
}
XmlPullUtil.exit(pp, "itdDateTime");