changeset 3836:06c76de19b51

Fix NullPointerException Check if array is null before accessing its length property. flys-client/trunk@5545 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Bjoern Ricks <bjoern.ricks@intevation.de>
date Fri, 21 Sep 2012 07:59:25 +0000
parents 11d74b9d428a
children 6b2ae2ec5b01
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/DoubleArrayPanel.java
diffstat 2 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Thu Sep 20 14:17:21 2012 +0000
+++ b/flys-client/ChangeLog	Fri Sep 21 07:59:25 2012 +0000
@@ -1,3 +1,8 @@
+2012-09-21	Björn Ricks	<bjoern.ricks@intevation.de>
+
+	* src/main/java/de/intevation/flys/client/client/ui/DoubleArrayPanel.java:
+	  Fix NullPointerException on not available list
+
 2012-09-20	Christian Lins	<christian.lins@intevation.de>
 
 	* src/main/java/de/intevation/flys/client/client/FLYSConstants.properties,
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/DoubleArrayPanel.java	Thu Sep 20 14:17:21 2012 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/DoubleArrayPanel.java	Fri Sep 21 07:59:25 2012 +0000
@@ -100,7 +100,7 @@
     public void setValues(double[] values) {
         NumberFormat f = NumberFormat.getDecimalFormat();
 
-        if(values.length == 0) {
+        if(values == null || values.length == 0) {
             ti.clearValue();
             return;
         }

http://dive4elements.wald.intevation.org