Repository: tapestry-5
Updated Branches:
  refs/heads/master 0b27da50f -> f71043e95


TAP5-1689: Fix NullPointerExceptions when trying to query or clear a Grid's 
sort model before the paginationModel has been setup


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/f71043e9
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/f71043e9
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/f71043e9

Branch: refs/heads/master
Commit: f71043e95b3d9afb5c3a462632a89b2a184e0015
Parents: 0b27da5
Author: Jochen Kemnade <[email protected]>
Authored: Thu Sep 4 13:16:31 2014 +0200
Committer: Jochen Kemnade <[email protected]>
Committed: Thu Sep 4 13:16:31 2014 +0200

----------------------------------------------------------------------
 .../main/java/org/apache/tapestry5/corelib/components/Grid.java   | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/f71043e9/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Grid.java
----------------------------------------------------------------------
diff --git 
a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Grid.java 
b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Grid.java
index c69a95d..6f84ae8 100644
--- 
a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Grid.java
+++ 
b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Grid.java
@@ -335,7 +335,7 @@ public class Grid implements GridModel, ClientElement
     {
         public ColumnSort getColumnSort(String columnId)
         {
-            if (!TapestryInternalUtils.isEqual(columnId, 
paginationModel.getSortColumnId()))
+            if (paginationModel == null || 
!TapestryInternalUtils.isEqual(columnId, paginationModel.getSortColumnId()))
             {
                 return ColumnSort.UNSORTED;
             }
@@ -381,6 +381,7 @@ public class Grid implements GridModel, ClientElement
 
         public void clear()
         {
+            setupPaginationModel();
             paginationModel.setSortColumnId(null);
             paginationModel.setSortAscending(null);
         }

Reply via email to