]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fixes #657 (throws if setArgs == null)
authorMarc Englund <marc.englund@itmill.com>
Wed, 7 May 2008 08:43:11 +0000 (08:43 +0000)
committerMarc Englund <marc.englund@itmill.com>
Wed, 7 May 2008 08:43:11 +0000 (08:43 +0000)
svn changeset:4365/svn branch:trunk

src/com/itmill/toolkit/data/util/MethodProperty.java

index 04ed811b63d8121f7d70f0b69a225dac8b22a70d..6bedad2729c5a9f6a2769e557d2e90f56df6523d 100644 (file)
@@ -461,10 +461,15 @@ public class MethodProperty implements Property {
                     "Property GET-method cannot not be null: " + type);
         }
 
-        if (setMethod != null
-                && (setArgumentIndex < 0 || setArgumentIndex >= setArgs.length)) {
-            throw new IndexOutOfBoundsException(
-                    "The setArgumentIndex must be >= 0 and < setArgs.length");
+        if (setMethod != null) {
+            if (setArgs == null) {
+                throw new IndexOutOfBoundsException(
+                        "The setArgs can not be null");
+            }
+            if (setArgumentIndex < 0 || setArgumentIndex >= setArgs.length) {
+                throw new IndexOutOfBoundsException(
+                        "The setArgumentIndex must be >= 0 and < setArgs.length");
+            }
         }
 
         // Gets the return type from get method