Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastien Gabel2016-07-07 09:48:33 +0000
committerGerrit Code Review @ Eclipse.org2016-07-07 15:21:14 +0000
commita893b892eabc4f7f85ae2af78373dc4fc1072ef7 (patch)
treecf340e03138189e856365a834bd4d38ef77037ef
parenta0fcd7a06af5e6ad5e824cc5ebbc50de955c279e (diff)
downloadorg.eclipse.papyrus-a893b892eabc4f7f85ae2af78373dc4fc1072ef7.tar.gz
org.eclipse.papyrus-a893b892eabc4f7f85ae2af78373dc4fc1072ef7.tar.xz
org.eclipse.papyrus-a893b892eabc4f7f85ae2af78373dc4fc1072ef7.zip
Bug 497467: [Table] Possible NPE in NattableModelManager when disposing
Change-Id: I55d00645454b9876cb1f2c022a7ecd0764c3b304 Signed-off-by: Sebastien Gabel <sebastien.gabel@esterel-technologies.com>
-rwxr-xr-xplugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/table/NattableModelManager.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/table/NattableModelManager.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/table/NattableModelManager.java
index b733b0de9ce..119762afff1 100755
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/table/NattableModelManager.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/table/NattableModelManager.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
+ * Copyright (c) 2012, 2016 CEA LIST, Esterel Technologies SAS and others.
*
*
* All rights reserved. This program and the accompanying materials
@@ -10,6 +10,7 @@
* Contributors:
* Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
* Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net - Bug 476618
+ * Nicolas Boulay (Esterel Technologies SAS) - Bug 497467
*
*****************************************************************************/
package org.eclipse.papyrus.infra.nattable.manager.table;
@@ -861,8 +862,12 @@ public class NattableModelManager extends AbstractNattableWidgetManager implemen
this.cellsMap.clear();
}
if (this.natTable != null) {
- natTable.removeLayerListener(this.layerListener);
- natTable.removeFocusListener(this.focusListener);
+ if (this.layerListener != null) {
+ natTable.removeLayerListener(this.layerListener);
+ }
+ if (this.focusListener != null) {
+ natTable.removeFocusListener(this.focusListener);
+ }
}
removeListeners();

Back to the top