svn changeset:22147/svn branch:6.7
final LinkedList<Object> visible = new LinkedList<Object>();
final Object[][] cells = getVisibleCells();
- for (int i = 0; i < cells[CELL_ITEMID].length; i++) {
- visible.add(cells[CELL_ITEMID][i]);
+ // may be null if the table has not been rendered yet (e.g. not attached
+ // to a layout)
+ if (null != cells) {
+ for (int i = 0; i < cells[CELL_ITEMID].length; i++) {
+ visible.add(cells[CELL_ITEMID][i]);
+ }
}
return visible;
*/
public void setCollapsed(Object itemId, boolean collapsed) {
if (isCollapsed(itemId) != collapsed) {
- if (null == toggledItemId && getVisibleItemIds().contains(itemId)
- && !isRowCacheInvalidated()) {
+ if (null == toggledItemId && !isRowCacheInvalidated()
+ && getVisibleItemIds().contains(itemId)) {
// optimization: partial refresh if only one item is
// collapsed/expanded
toggledItemId = itemId;