You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by mc...@apache.org on 2008/01/22 19:37:06 UTC

svn commit: r614282 - /myfaces/trinidad/branches/1.2.4.1-branch/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTableTemplate.java

Author: mcooper
Date: Tue Jan 22 10:36:58 2008
New Revision: 614282

URL: http://svn.apache.org/viewvc?rev=614282&view=rev
Log:
TRINIDAD-914 Selected and disclosed row key sets in UIXTableTemplate.java are assumed to be non-null

Added checks in UIXTableTemplate.createCollectionModel() for null selectedRowKeys and disclosedRowKeys before invoking methods on them respectively so that it will not throw any NPEs.

Modified:
    myfaces/trinidad/branches/1.2.4.1-branch/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTableTemplate.java

Modified: myfaces/trinidad/branches/1.2.4.1-branch/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTableTemplate.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.4.1-branch/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTableTemplate.java?rev=614282&r1=614281&r2=614282&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.4.1-branch/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTableTemplate.java (original)
+++ myfaces/trinidad/branches/1.2.4.1-branch/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTableTemplate.java Tue Jan 22 10:36:58 2008
@@ -311,8 +311,18 @@
   {
     CollectionModel model = super.createCollectionModel(current, value); 
 
-    getSelectedRowKeys().setCollectionModel(model);
-    getDisclosedRowKeys().setCollectionModel(model);
+    RowKeySet selectedRowKeys = getSelectedRowKeys();
+    RowKeySet disclosedRowKeys = getDisclosedRowKeys();
+
+    if (selectedRowKeys != null)
+    {
+      selectedRowKeys.setCollectionModel(model);
+    }
+
+    if (disclosedRowKeys != null)
+    {
+      disclosedRowKeys.setCollectionModel(model);
+    }
 
     // If we were perviously sorted, restore the sort order:
     if (_sortCriteria != null)