[PATCH] Prevent NPE when trying to add an empty facet list

Wald Commits scm-commit at wald.intevation.org
Thu Aug 28 15:32:00 CEST 2014


# HG changeset patch
# User Sascha L. Teichmann <teichmann at intevation.de>
# Date 1409232688 -7200
# Node ID ae40cf24f158d06db1ff67cdf0892d9e8b47f3f8
# Parent  e149751b9c6d4b2234088529c3fdd48400b0e0e3
Prevent NPE when trying to add an empty facet list.

diff -r e149751b9c6d -r ae40cf24f158 artifact-database/src/main/java/org/dive4elements/artifactdatabase/state/DefaultOutput.java
--- a/artifact-database/src/main/java/org/dive4elements/artifactdatabase/state/DefaultOutput.java	Tue Jul 08 18:35:13 2014 +0200
+++ b/artifact-database/src/main/java/org/dive4elements/artifactdatabase/state/DefaultOutput.java	Thu Aug 28 15:31:28 2014 +0200
@@ -140,7 +140,9 @@
 
 
     public void addFacets(List<Facet> facets) {
-        this.facets.addAll(facets);
+        if (facets != null) {
+            this.facets.addAll(facets);
+        }
     }
 
 


More information about the Dive4Elements-commits mailing list