Bug 195337 - Check gtk widget style initialization.

Sometimes wigets do not have an initialized style object
despite the widget being realized. In that case it makes
sense to return an uninitialized GdkColor object.

Change-Id: I4e1923f4cfe386e96968dbab93bf9214add793a3
Signed-off-by: Sami Wagiaalla <swagiaal@redhat.com>
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java
index 2919e2f..7a4339a 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java
@@ -2555,7 +2555,12 @@
 	long /*int*/ fontHandle = fontHandle ();
 	OS.gtk_widget_realize (fontHandle);
 	GdkColor color = new GdkColor ();
-	OS.gtk_style_get_bg (OS.gtk_widget_get_style (fontHandle), OS.GTK_STATE_NORMAL, color);
+
+	long /*int*/ style = OS.gtk_widget_get_style (fontHandle);
+	if (style != 0){
+		OS.gtk_style_get_bg (style, OS.GTK_STATE_NORMAL, color);
+	}
+
 	return color;
 }
 
@@ -2702,7 +2707,11 @@
 	long /*int*/ fontHandle = fontHandle ();
 	OS.gtk_widget_realize (fontHandle);
 	GdkColor color = new GdkColor ();
-	OS.gtk_style_get_fg (OS.gtk_widget_get_style (fontHandle), OS.GTK_STATE_NORMAL, color);
+
+	long /*int*/ style = OS.gtk_widget_get_style (fontHandle);
+	if (style != 0){
+		OS.gtk_style_get_fg (style, OS.GTK_STATE_NORMAL, color);
+	}
 	return color;
 }