click-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sa...@apache.org
Subject svn commit: r910489 - /click/trunk/click/extras/src/org/apache/click/extras/control/FormTable.java
Date Tue, 16 Feb 2010 11:51:30 GMT
Author: sabob
Date: Tue Feb 16 11:51:29 2010
New Revision: 910489

URL: http://svn.apache.org/viewvc?rev=910489&view=rev
Log:
guard against null fields. CLK-626

Modified:
    click/trunk/click/extras/src/org/apache/click/extras/control/FormTable.java

Modified: click/trunk/click/extras/src/org/apache/click/extras/control/FormTable.java
URL: http://svn.apache.org/viewvc/click/trunk/click/extras/src/org/apache/click/extras/control/FormTable.java?rev=910489&r1=910488&r2=910489&view=diff
==============================================================================
--- click/trunk/click/extras/src/org/apache/click/extras/control/FormTable.java (original)
+++ click/trunk/click/extras/src/org/apache/click/extras/control/FormTable.java Tue Feb 16
11:51:29 2010
@@ -331,12 +331,14 @@
             if (column instanceof FieldColumn) {
                 Field field = ((FieldColumn) column).getField();
 
-                for (int j = firstRow; j < lastRow; j++) {
-                    field.setName(column.getName() + "_" + j);
+                if (field != null) {
+                    for (int j = firstRow; j < lastRow; j++) {
+                        field.setName(column.getName() + "_" + j);
 
-                    htmlImports = field.getHtmlImports();
-                    if (htmlImports != null) {
-                        buffer.append(htmlImports);
+                        htmlImports = field.getHtmlImports();
+                        if (htmlImports != null) {
+                            buffer.append(htmlImports);
+                        }
                     }
                 }
             }
@@ -365,10 +367,12 @@
                 if (column instanceof FieldColumn) {
                     Field field = ((FieldColumn) column).getField();
 
-                    for (int j = firstRow; j < lastRow; j++) {
-                        field.setName(column.getName() + "_" + j);
+                    if (field != null) {
+                        for (int j = firstRow; j < lastRow; j++) {
+                            field.setName(column.getName() + "_" + j);
 
-                        headElements.addAll(field.getHeadElements());
+                            headElements.addAll(field.getHeadElements());
+                        }
                     }
                 }
             }
@@ -546,15 +550,17 @@
                         FieldColumn fieldColumn = (FieldColumn) column;
                         Field field = fieldColumn.getField();
 
-                        field.setName(column.getName() + "_" + i);
+                        if (field != null) {
+                            field.setName(column.getName() + "_" + i);
 
-                        field.onProcess();
+                            field.onProcess();
 
-                        if (field.isValid()) {
-                            fieldColumn.setProperty(row, column.getName(),
-                                field.getValueObject());
-                        } else {
-                            getForm().setError(getMessage("formtable-error"));
+                            if (field.isValid()) {
+                                fieldColumn.setProperty(row, column.getName(),
+                                    field.getValueObject());
+                            } else {
+                                getForm().setError(getMessage("formtable-error"));
+                            }
                         }
                     }
                 }



Mime
View raw message