Mercurial > dive4elements > framework
changeset 447:ddfaf255bb40
Fix: Don't fail with NPE if no hooks are found in the xml file
author | Björn Ricks <bjoern.ricks@intevation.de> |
---|---|
date | Wed, 12 Dec 2012 16:05:15 +0100 |
parents | 5803c2078f0c |
children | f2eab30cbc9a |
files | artifact-database/src/main/java/de/intevation/artifactdatabase/FactoryBootstrap.java |
diffstat | 1 files changed, 5 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/artifact-database/src/main/java/de/intevation/artifactdatabase/FactoryBootstrap.java Fri Nov 16 18:36:49 2012 +0100 +++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/FactoryBootstrap.java Wed Dec 12 16:05:15 2012 +0100 @@ -550,6 +550,11 @@ NodeList nodes = Config.getNodeSetXPath(HOOKS); + if (nodes == null) { + logger.info("No hooks found"); + return; + } + for (int i = 0, len = nodes.getLength(); i < len; i++) { Node cfg = nodes.item(i); String applies = Config.getStringXPath(cfg, "@applies");