fix exception when head is null
This commit is contained in:
parent
86dc04fcd9
commit
1a09f86736
1 changed files with 42 additions and 42 deletions
|
@ -106,61 +106,61 @@ public class OPML10Parser extends BaseWireFeedParser implements WireFeedParser {
|
||||||
opml.setOwnerName(head.getChildTextTrim("ownerName"));
|
opml.setOwnerName(head.getChildTextTrim("ownerName"));
|
||||||
opml.setOwnerEmail(head.getChildTextTrim("ownerEmail"));
|
opml.setOwnerEmail(head.getChildTextTrim("ownerEmail"));
|
||||||
opml.setVerticalScrollState(readInteger(head.getChildText("vertScrollState")));
|
opml.setVerticalScrollState(readInteger(head.getChildText("vertScrollState")));
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
opml.setWindowBottom(readInteger(head.getChildText("windowBottom")));
|
opml.setWindowBottom(readInteger(head.getChildText("windowBottom")));
|
||||||
} catch (final NumberFormatException nfe) {
|
} catch (final NumberFormatException nfe) {
|
||||||
LOG.warn("Unable to parse windowBottom", nfe);
|
LOG.warn("Unable to parse windowBottom", nfe);
|
||||||
|
|
||||||
if (validate) {
|
if (validate) {
|
||||||
throw new FeedException("Unable to parse windowBottom", nfe);
|
throw new FeedException("Unable to parse windowBottom", nfe);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
opml.setWindowLeft(readInteger(head.getChildText("windowLeft")));
|
opml.setWindowLeft(readInteger(head.getChildText("windowLeft")));
|
||||||
} catch (final NumberFormatException nfe) {
|
} catch (final NumberFormatException nfe) {
|
||||||
LOG.warn("Unable to parse windowLeft", nfe);
|
LOG.warn("Unable to parse windowLeft", nfe);
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
opml.setWindowRight(readInteger(head.getChildText("windowRight")));
|
|
||||||
} catch (final NumberFormatException nfe) {
|
|
||||||
LOG.warn("Unable to parse windowRight", nfe);
|
|
||||||
|
|
||||||
if (validate) {
|
|
||||||
throw new FeedException("Unable to parse windowRight", nfe);
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
opml.setWindowLeft(readInteger(head.getChildText("windowLeft")));
|
opml.setWindowRight(readInteger(head.getChildText("windowRight")));
|
||||||
} catch (final NumberFormatException nfe) {
|
} catch (final NumberFormatException nfe) {
|
||||||
LOG.warn("Unable to parse windowLeft", nfe);
|
LOG.warn("Unable to parse windowRight", nfe);
|
||||||
|
|
||||||
if (validate) {
|
if (validate) {
|
||||||
throw new FeedException("Unable to parse windowLeft", nfe);
|
throw new FeedException("Unable to parse windowRight", nfe);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
opml.setWindowTop(readInteger(head.getChildText("windowTop")));
|
opml.setWindowLeft(readInteger(head.getChildText("windowLeft")));
|
||||||
} catch (final NumberFormatException nfe) {
|
} catch (final NumberFormatException nfe) {
|
||||||
LOG.warn("Unable to parse windowTop", nfe);
|
LOG.warn("Unable to parse windowLeft", nfe);
|
||||||
|
|
||||||
if (validate) {
|
if (validate) {
|
||||||
throw new FeedException("Unable to parse windowTop", nfe);
|
throw new FeedException("Unable to parse windowLeft", nfe);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
opml.setExpansionState(readIntArray(head.getChildText("expansionState")));
|
opml.setWindowTop(readInteger(head.getChildText("windowTop")));
|
||||||
} catch (final NumberFormatException nfe) {
|
} catch (final NumberFormatException nfe) {
|
||||||
LOG.warn("Unable to parse expansionState", nfe);
|
LOG.warn("Unable to parse windowTop", nfe);
|
||||||
|
|
||||||
if (validate) {
|
if (validate) {
|
||||||
throw new FeedException("Unable to parse expansionState", nfe);
|
throw new FeedException("Unable to parse windowTop", nfe);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
opml.setExpansionState(readIntArray(head.getChildText("expansionState")));
|
||||||
|
} catch (final NumberFormatException nfe) {
|
||||||
|
LOG.warn("Unable to parse expansionState", nfe);
|
||||||
|
|
||||||
|
if (validate) {
|
||||||
|
throw new FeedException("Unable to parse expansionState", nfe);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue