mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-13 16:20:34 +00:00
EFA: Check for empty document.
This commit is contained in:
parent
70c1037bc4
commit
0b42b39fd7
1 changed files with 8 additions and 2 deletions
|
@ -3288,13 +3288,16 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
||||||
private ResultHeader enterItdRequest(final XmlPullParser pp) throws XmlPullParserException, IOException
|
private ResultHeader enterItdRequest(final XmlPullParser pp) throws XmlPullParserException, IOException
|
||||||
{
|
{
|
||||||
if (pp.getEventType() != XmlPullParser.START_DOCUMENT)
|
if (pp.getEventType() != XmlPullParser.START_DOCUMENT)
|
||||||
throw new IllegalStateException("start of document expected");
|
throw new ParserException("start of document expected");
|
||||||
|
|
||||||
pp.next();
|
pp.next();
|
||||||
|
|
||||||
if (pp.getEventType() == XmlPullParser.DOCDECL)
|
if (pp.getEventType() == XmlPullParser.DOCDECL)
|
||||||
pp.next();
|
pp.next();
|
||||||
|
|
||||||
|
if (pp.getEventType() == XmlPullParser.END_DOCUMENT)
|
||||||
|
throw new ParserException("empty document");
|
||||||
|
|
||||||
XmlPullUtil.require(pp, "itdRequest");
|
XmlPullUtil.require(pp, "itdRequest");
|
||||||
|
|
||||||
final String serverVersion = XmlPullUtil.attr(pp, "version");
|
final String serverVersion = XmlPullUtil.attr(pp, "version");
|
||||||
|
@ -3330,10 +3333,13 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
||||||
private ResultHeader enterEfa(final XmlPullParser pp) throws XmlPullParserException, IOException
|
private ResultHeader enterEfa(final XmlPullParser pp) throws XmlPullParserException, IOException
|
||||||
{
|
{
|
||||||
if (pp.getEventType() != XmlPullParser.START_DOCUMENT)
|
if (pp.getEventType() != XmlPullParser.START_DOCUMENT)
|
||||||
throw new IllegalStateException("start of document expected");
|
throw new ParserException("start of document expected");
|
||||||
|
|
||||||
pp.next();
|
pp.next();
|
||||||
|
|
||||||
|
if (pp.getEventType() == XmlPullParser.END_DOCUMENT)
|
||||||
|
throw new ParserException("empty document");
|
||||||
|
|
||||||
XmlPullUtil.enter(pp, "efa");
|
XmlPullUtil.enter(pp, "efa");
|
||||||
|
|
||||||
final String now = XmlPullUtil.valueTag(pp, "now");
|
final String now = XmlPullUtil.valueTag(pp, "now");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue