changeset 1012:388e709224ec

Fixed potential NPE in collection monitor flys-artifacts/trunk@2458 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Wed, 03 Aug 2011 08:25:28 +0000
parents aca3b46160cb
children 73330e89b0af
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/CollectionMonitor.java
diffstat 2 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Tue Aug 02 22:16:16 2011 +0000
+++ b/flys-artifacts/ChangeLog	Wed Aug 03 08:25:28 2011 +0000
@@ -1,3 +1,8 @@
+2011-08-03  Sascha L. Teichmann <sascha.teichmann@intevation.de>
+
+	* src/main/java/de/intevation/flys/artifacts/CollectionMonitor.java(extractOutputNames):
+	  Fixed potential NPE.
+
 2011-08-03  Sascha L. Teichmann <sascha.teichmann@intevation.de>
 
 	Added support for more than one db connection in datacage templating.
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/CollectionMonitor.java	Tue Aug 02 22:16:16 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/CollectionMonitor.java	Wed Aug 03 08:25:28 2011 +0000
@@ -70,9 +70,12 @@
         CallContext  context)
     {
         List<Output> outs = flys.getCurrentOutputs(context);
-        String[]    names = new String[outs.size()];
 
-        for (int i = 0, num = outs != null ? outs.size() : 0; i < num; i++) {
+        int num = outs == null ? 0 : outs.size();
+
+        String[] names = new String[num];
+
+        for (int i = 0; i < num; i++) {
             names[i] = outs.get(i).getName();
         }
 

http://dive4elements.wald.intevation.org