aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2012-03-22 09:03:15 (EDT)
committerSilenio Quarti2012-03-26 10:22:11 (EDT)
commit46c5fabaeb41b9364a0f255388ea7d8e9a37f524 (patch)
treece98898ecd8ede778c3c1e06471823df6ae69c1b
parent692e3b97871b9238b6ca6fdecaeb07a89b264085 (diff)
downloadeclipse.platform.swt-46c5fabaeb41b9364a0f255388ea7d8e9a37f524.zip
eclipse.platform.swt-46c5fabaeb41b9364a0f255388ea7d8e9a37f524.tar.gz
eclipse.platform.swt-46c5fabaeb41b9364a0f255388ea7d8e9a37f524.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);
+ }
}
/**