changeset 2212:588db6f2e05a

Avoid running into an NPE, but add warning to ease forensic. flys-artifacts/trunk@3846 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Wed, 01 Feb 2012 08:37:38 +0000
parents 5400631d2f96
children 4cb2f5a78a82
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/collections/FLYSArtifactCollection.java
diffstat 2 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Tue Jan 31 16:26:30 2012 +0000
+++ b/flys-artifacts/ChangeLog	Wed Feb 01 08:37:38 2012 +0000
@@ -1,3 +1,8 @@
+2012-01-31  Felix Wolfsteller	<felix.wolfsteller@intevation.de>
+
+	* src/main/java/de/intevation/flys/collections/FLYSArtifactCollection.java:
+	  Avoid NPE, add warning to log to not forget about it.
+
 2012-01-31	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
 
 	* src/main/java/de/intevation/flys/artifacts/model/Calculation.java:
--- a/flys-artifacts/src/main/java/de/intevation/flys/collections/FLYSArtifactCollection.java	Tue Jan 31 16:26:30 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/collections/FLYSArtifactCollection.java	Wed Feb 01 08:37:38 2012 +0000
@@ -455,6 +455,10 @@
             // Collect all ArtifactAndFacets for blackboard pass.
             for (int i = 0; i < size; i++) {
                 ManagedFacet theme = themeList.get(i);
+                if (theme == null) {
+                    log.warn("A ManagedFacet in ThemeList is null.");
+                    continue;
+                }
                 String uuid        = theme.getArtifact();
                 Artifact artifact  = getArtifact(uuid, context);
                 FLYSArtifact flys  = (FLYSArtifact) artifact;

http://dive4elements.wald.intevation.org