Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDirk Fauth2016-04-28 19:08:24 +0000
committerDirk Fauth2016-04-28 19:08:24 +0000
commit41643cd8b6aac667c3d959f9d948164911a86f1b (patch)
tree16d9d815f42d5c4d2e8c9e64cb87b82cc4bc1c28
parentd521ab8e1fc754b9ba7ae0421d4ad3866205c48a (diff)
downloadorg.eclipse.nebula.widgets.nattable-41643cd8b6aac667c3d959f9d948164911a86f1b.tar.gz
org.eclipse.nebula.widgets.nattable-41643cd8b6aac667c3d959f9d948164911a86f1b.tar.xz
org.eclipse.nebula.widgets.nattable-41643cd8b6aac667c3d959f9d948164911a86f1b.zip
Bug 492663 - Get a NullPointerException when unregister UI binding
Change-Id: I7f2a6e6a00d995a120981773aafc5735925b1abc Signed-off-by: Dirk Fauth <dirk.fauth@googlemail.com>
-rw-r--r--org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/ui/binding/UiBindingRegistry.java16
1 files changed, 8 insertions, 8 deletions
diff --git a/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/ui/binding/UiBindingRegistry.java b/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/ui/binding/UiBindingRegistry.java
index 379a0298..97a1fcae 100644
--- a/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/ui/binding/UiBindingRegistry.java
+++ b/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/ui/binding/UiBindingRegistry.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Original authors and others.
+ * Copyright (c) 2012, 2016 Original authors and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -270,8 +270,7 @@ public class UiBindingRegistry implements IUiBindingRegistry {
// /////////////////////////////////////////////////////////////////////////
- private void registerMouseBinding(boolean first,
- MouseEventTypeEnum mouseEventType, IMouseEventMatcher mouseEventMatcher, IMouseAction action) {
+ private void registerMouseBinding(boolean first, MouseEventTypeEnum mouseEventType, IMouseEventMatcher mouseEventMatcher, IMouseAction action) {
LinkedList<MouseBinding> mouseEventBindings = this.mouseBindingsMap.get(mouseEventType);
if (mouseEventBindings == null) {
mouseEventBindings = new LinkedList<MouseBinding>();
@@ -286,16 +285,17 @@ public class UiBindingRegistry implements IUiBindingRegistry {
private void unregisterMouseBinding(MouseEventTypeEnum mouseEventType, IMouseEventMatcher mouseEventMatcher) {
LinkedList<MouseBinding> mouseBindings = this.mouseBindingsMap.get(mouseEventType);
- for (MouseBinding mouseBinding : mouseBindings) {
- if (mouseBinding.getMouseEventMatcher().equals(mouseEventMatcher)) {
- mouseBindings.remove(mouseBinding);
- return;
+ if (mouseBindings != null) {
+ for (MouseBinding mouseBinding : mouseBindings) {
+ if (mouseBinding.getMouseEventMatcher().equals(mouseEventMatcher)) {
+ mouseBindings.remove(mouseBinding);
+ return;
+ }
}
}
}
private enum MouseEventTypeEnum {
-
MOUSE_DOWN, MOUSE_MOVE, MOUSE_SINGLE_CLICK, MOUSE_DOUBLE_CLICK, MOUSE_HOVER, MOUSE_ENTER, MOUSE_EXIT
}

Back to the top