aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2012-03-22 09:03:15 (EDT)
committerBogdan Gheorghe2012-04-26 17:00:11 (EDT)
commitbee941fb91191b20eabec31b203fdc7c3bfb887f (patch)
treeb97ddefc1a01f4b4b551a3c7285185e47ee8734e
parent4171be6f67f46f1e929fa0a3983cfd3767530819 (diff)
downloadeclipse.platform.swt-bee941fb91191b20eabec31b203fdc7c3bfb887f.zip
eclipse.platform.swt-bee941fb91191b20eabec31b203fdc7c3bfb887f.tar.gz
eclipse.platform.swt-bee941fb91191b20eabec31b203fdc7c3bfb887f.tar.bz2
Fix crash when the widget doesn't have a child.
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java
index 3d71e87..d190f5f 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java
@@ -940,7 +940,10 @@ void setFontDescription (int /*long*/ font) {
}
void setForegroundColor (GdkColor color) {
- setForegroundColor (OS.gtk_bin_get_child(handle), color);
+ int /*long*/ childHandle = OS.gtk_bin_get_child(handle);
+ if (childHandle != 0) {
+ setForegroundColor (childHandle, color);
+ }
}
/**