mirror of
https://github.com/2006-Scape/Parabot.git
synced 2026-07-03 08:39:09 +00:00
Add an NPE catch wtih useful message
This commit is contained in:
@@ -65,6 +65,9 @@ public class XMLHookParser extends HookParser {
|
||||
}
|
||||
|
||||
private static final String getValue(String tag, Element element) {
|
||||
if (element.getElementsByTagName(tag).item(0) == null) {
|
||||
throw new NullPointerException("MISSING HOOK TAG: The '"+tag+"' xml tag is missing from one of the hooks of type: "+element.getParentNode().getNodeName());
|
||||
}
|
||||
NodeList nodes = element.getElementsByTagName(tag).item(0)
|
||||
.getChildNodes();
|
||||
if (nodes.getLength() == 0 || nodes.item(0) == null) {
|
||||
|
||||
Reference in New Issue
Block a user