Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDirk Fauth2023-02-08 17:31:53 +0000
committerDirk Fauth2023-02-08 17:31:53 +0000
commitf0dedb4add30dcfd29931b876bd42ebe35f1de38 (patch)
treeb6087db21a68645b7e994786ec71dccb789ba740
parentc9c39eceb8551fbf918e413d9f772866640796fd (diff)
downloadorg.eclipse.nebula.widgets.nattable-f0dedb4add30dcfd29931b876bd42ebe35f1de38.tar.gz
org.eclipse.nebula.widgets.nattable-f0dedb4add30dcfd29931b876bd42ebe35f1de38.tar.xz
org.eclipse.nebula.widgets.nattable-f0dedb4add30dcfd29931b876bd42ebe35f1de38.zip
Bug 581505 - NPE in SelectionLayerPainter#isInCurrentLayer()
Signed-off-by: Dirk Fauth <dirk.fauth@googlemail.com> Change-Id: Idd5d3043af21a97437612517288d279ff87154c1
-rw-r--r--org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/selection/SelectionLayerPainter.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/selection/SelectionLayerPainter.java b/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/selection/SelectionLayerPainter.java
index fbb16242..945c3300 100644
--- a/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/selection/SelectionLayerPainter.java
+++ b/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/selection/SelectionLayerPainter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012, 2020 Original authors and others.
+ * Copyright (c) 2012, 2023 Original authors and others.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
@@ -316,7 +316,7 @@ public class SelectionLayerPainter extends GridLineCellLayerPainter {
if (ix == 1) {
if (borderCells[iy][ix - 1].isInsideBorder) {
Rectangle prevCellBounds = borderCells[iy][ix - 1].bounds;
- if (prevCellBounds.x + prevCellBounds.width > cellBounds.x) {
+ if ((prevCellBounds != null) && (prevCellBounds.x + prevCellBounds.width > cellBounds.x)) {
borderCells[iy][ix - 1].isInsideBorder = false;
}
}
@@ -324,7 +324,7 @@ public class SelectionLayerPainter extends GridLineCellLayerPainter {
if (iy == 1) {
if (borderCells[iy - 1][ix].isInsideBorder) {
Rectangle prevCellBounds = borderCells[iy - 1][ix].bounds;
- if (prevCellBounds.y + prevCellBounds.height > cellBounds.y) {
+ if ((prevCellBounds != null) && (prevCellBounds.y + prevCellBounds.height > cellBounds.y)) {
borderCells[iy - 1][ix].isInsideBorder = false;
}
}
@@ -334,13 +334,13 @@ public class SelectionLayerPainter extends GridLineCellLayerPainter {
// cell, we consider it part of another layer
if (ix == borderCells[iy].length - 1) {
Rectangle prevCellBounds = borderCells[iy][ix - 1].bounds;
- if (prevCellBounds.x + prevCellBounds.width > cellBounds.x) {
+ if ((prevCellBounds != null) && (prevCellBounds.x + prevCellBounds.width > cellBounds.x)) {
return false;
}
}
if (iy == borderCells.length - 1) {
Rectangle prevCellBounds = borderCells[iy - 1][ix].bounds;
- if (prevCellBounds.y + prevCellBounds.height > cellBounds.y) {
+ if ((prevCellBounds != null) && (prevCellBounds.y + prevCellBounds.height > cellBounds.y)) {
return false;
}
}

Back to the top