aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormpaturzo2014-03-24 05:21:16 (EDT)
committermpaturzo2014-03-24 05:21:16 (EDT)
commit1f0e6e5bc912227c764b5c42b0e9900f69a09f30 (patch)
tree9887dd45518395979b7f8f419106083eb0669202
parent16d49e08e6afc74ed7d6a3012fd217b978c41b10 (diff)
downloadorg.eclipse.nebula-1f0e6e5bc912227c764b5c42b0e9900f69a09f30.zip
org.eclipse.nebula-1f0e6e5bc912227c764b5c42b0e9900f69a09f30.tar.gz
org.eclipse.nebula-1f0e6e5bc912227c764b5c42b0e9900f69a09f30.tar.bz2
Bug 430879 - ArrayIndexOutOfBoundsException in GridItemDataVisualizerrefs/changes/78/23778/1
add guard for column < 0 in GridItemDataVisualizer.getValueOrDefault Change-Id: I12d8912257f2faf1f8ce2a29a949a78ffef51069 Signed-off-by: mpaturzo <caosmpz@yahoo.it>
-rw-r--r--widgets/grid/org.eclipse.nebula.widgets.grid/src/org/eclipse/nebula/widgets/grid/GridItemDataVisualizer.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/widgets/grid/org.eclipse.nebula.widgets.grid/src/org/eclipse/nebula/widgets/grid/GridItemDataVisualizer.java b/widgets/grid/org.eclipse.nebula.widgets.grid/src/org/eclipse/nebula/widgets/grid/GridItemDataVisualizer.java
index ef3157d..8093d87 100644
--- a/widgets/grid/org.eclipse.nebula.widgets.grid/src/org/eclipse/nebula/widgets/grid/GridItemDataVisualizer.java
+++ b/widgets/grid/org.eclipse.nebula.widgets.grid/src/org/eclipse/nebula/widgets/grid/GridItemDataVisualizer.java
@@ -104,6 +104,10 @@ public class GridItemDataVisualizer implements DataVisualizer {
* @return T
*/
protected <T> T getValueOrDefault(Map<GridItem, List<T>> map, GridItem gridItem, int column, T defaultValue) {
+
+ if(column < 0)
+ return defaultValue;
+
List<T> list = map.get(gridItem);
if (list == null || column >= list.size())
return defaultValue;