Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Williams2016-01-19 20:16:57 +0000
committerEric Williams2016-02-09 19:00:42 +0000
commit1a375bfbb7dca92b102db09891a18eeb80d671f2 (patch)
treeeaecd01c48edae377261de3d582f365c22ae9c8f
parent6ee654cf704fbc03f958bcbc3188ef4cf822db70 (diff)
downloadeclipse.platform.swt-1a375bfbb7dca92b102db09891a18eeb80d671f2.tar.gz
eclipse.platform.swt-1a375bfbb7dca92b102db09891a18eeb80d671f2.tar.xz
eclipse.platform.swt-1a375bfbb7dca92b102db09891a18eeb80d671f2.zip
Bug 486069: [Wayland] NullPointerException in TabFolder when running
ControlExample This patch adds a missing logic check to prevent a GtkNotebook from switching to a page that doesn't exist. Wayland seems to trigger an early page switch, causing gtk_notebook_get_current_page() to return -1. This will cause a NullPointerException in TabFolder.gtk_switch_page(). Tested on GTK3.19.6, and 3.18. AllNonBrowser JUnit tests pass on GTK3.19.6 (with the exception of an unrelated previously failing test case). Change-Id: I720a7b08c0b49bebce15951f5d5deb00a2304839 Signed-off-by: Eric Williams <ericwill@redhat.com>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabFolder.java2
1 files changed, 2 insertions, 0 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabFolder.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabFolder.java
index 7344bf70dc..00e157cf6b 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabFolder.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabFolder.java
@@ -565,6 +565,8 @@ long /*int*/ gtk_switch_page (long /*int*/ widget, long /*int*/ page, long /*int
if (control != null && !control.isDisposed ()) {
control.setVisible (false);
}
+ } else {
+ return 0;
}
TabItem item = items [(int)/*64*/page_num];
Control control = item.getControl ();

Back to the top