From b98ddbb34a1a28dc8fd80b077c28084380590a71 Mon Sep 17 00:00:00 2001 From: Jonatan Kronqvist Date: Wed, 27 Apr 2011 11:34:03 +0000 Subject: [PATCH] Null pointer checks added to the fix for #6697 based on review svn changeset:18496/svn branch:6.6 --- src/com/vaadin/ui/Table.java | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/src/com/vaadin/ui/Table.java b/src/com/vaadin/ui/Table.java index b14df2cdaa..4d4293e655 100644 --- a/src/com/vaadin/ui/Table.java +++ b/src/com/vaadin/ui/Table.java @@ -2236,21 +2236,21 @@ public class Table extends AbstractSelect implements Action.Container, Object propertyId = null; if (cid != null) { propertyId = columnIdMap.get(cid.toString()); - } - Object prev = variables.get("columnResizeEventPrev"); - int previousWidth = -1; - if (prev != null) { - previousWidth = Integer.valueOf(prev.toString()); - } + Object prev = variables.get("columnResizeEventPrev"); + int previousWidth = -1; + if (prev != null) { + previousWidth = Integer.valueOf(prev.toString()); + } - Object curr = variables.get("columnResizeEventCurr"); - int currentWidth = -1; - if (curr != null) { - currentWidth = Integer.valueOf(curr.toString()); - } + Object curr = variables.get("columnResizeEventCurr"); + int currentWidth = -1; + if (curr != null) { + currentWidth = Integer.valueOf(curr.toString()); + } - fireColumnResizeEvent(propertyId, previousWidth, currentWidth); + fireColumnResizeEvent(propertyId, previousWidth, currentWidth); + } } private void handleMultipleColumnResizeEvents(Map variables) { @@ -2258,10 +2258,12 @@ public class Table extends AbstractSelect implements Action.Container, for (String str : events) { String[] eventDetails = str.split(":"); Object propertyId = columnIdMap.get(eventDetails[0]); - int curWidth = Integer.valueOf(eventDetails[1]); - int prevWidth = getColumnWidth(propertyId); + if (propertyId != null) { + int curWidth = Integer.valueOf(eventDetails[1]); + int prevWidth = getColumnWidth(propertyId); - fireColumnResizeEvent(propertyId, prevWidth, curWidth); + fireColumnResizeEvent(propertyId, prevWidth, curWidth); + } } } -- 2.39.5