Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDirk Fauth2022-12-19 09:01:17 +0000
committerDirk Fauth2022-12-19 09:21:30 +0000
commit4b2ae5070a42c18b81fe2a4439dcca87577acf89 (patch)
tree49eba76020968402f426d510ee8ef5065a705f5a
parent9375ae03a5744d1737195ee457a871e225919ff5 (diff)
downloadorg.eclipse.nebula.widgets.nattable-4b2ae5070a42c18b81fe2a4439dcca87577acf89.tar.gz
org.eclipse.nebula.widgets.nattable-4b2ae5070a42c18b81fe2a4439dcca87577acf89.tar.xz
org.eclipse.nebula.widgets.nattable-4b2ae5070a42c18b81fe2a4439dcca87577acf89.zip
Bug 581245 - NPE in PersistenceDialog on button click without selection
Signed-off-by: Dirk Fauth <dirk.fauth@googlemail.com> Change-Id: I88090c9b1972b1dc9565499465b9f6ce3c58073e
-rw-r--r--org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/persistence/gui/PersistenceDialog.java10
-rw-r--r--pom.xml2
2 files changed, 6 insertions, 6 deletions
diff --git a/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/persistence/gui/PersistenceDialog.java b/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/persistence/gui/PersistenceDialog.java
index 7c86c731..0a8e36cd 100644
--- a/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/persistence/gui/PersistenceDialog.java
+++ b/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/persistence/gui/PersistenceDialog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012, 2020 Dirk Fauth and others.
+ * Copyright (c) 2012, 2022 Dirk Fauth and others.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
@@ -225,7 +225,7 @@ public class PersistenceDialog extends Dialog {
this.viewer
.addSelectionChangedListener(event -> {
ISelection selection = event.getSelection();
- if (selection instanceof IStructuredSelection) {
+ if (selection instanceof IStructuredSelection && !selection.isEmpty()) {
String configName = ((IStructuredSelection) selection)
.getFirstElement().toString();
PersistenceDialog.this.configNameText.setText(configName);
@@ -303,7 +303,7 @@ public class PersistenceDialog extends Dialog {
StateChangeType.CREATE));
} else if (buttonId == DELETE_ID) {
ISelection selection = this.viewer.getSelection();
- if (selection instanceof IStructuredSelection) {
+ if (selection instanceof IStructuredSelection && !selection.isEmpty()) {
String configName = ((IStructuredSelection) selection)
.getFirstElement().toString();
PersistenceHelper.deleteState(configName, this.properties);
@@ -317,13 +317,13 @@ public class PersistenceDialog extends Dialog {
}
} else if (buttonId == LOAD_ID) {
ISelection selection = this.viewer.getSelection();
- if (selection instanceof IStructuredSelection) {
+ if (selection instanceof IStructuredSelection && !selection.isEmpty()) {
String configName = ((IStructuredSelection) selection)
.getFirstElement().toString();
this.natTable.loadState(configName, this.properties);
setActiveViewConfigurationName(configName);
+ super.okPressed();
}
- super.okPressed();
} else {
super.buttonPressed(buttonId);
}
diff --git a/pom.xml b/pom.xml
index ef3975f9..77af58d9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -70,7 +70,7 @@
<properties>
<tycho-version>2.0.0</tycho-version>
- <cbi-version>1.3.2</cbi-version>
+ <cbi-version>1.3.4</cbi-version>
<nattable-version>${project.version}</nattable-version>
<maven.compiler.source>1.8</maven.compiler.source>

Back to the top