Check if string is non-NULL

2001-12-07  Bradford Hovinen  <hovinen@ximian.com>

	* preferences.c (read_color_from_string): Check if string is
	non-NULL
This commit is contained in:
Bradford Hovinen 2001-12-07 19:34:21 +00:00 committed by Bradford Hovinen (Gdict maintainer)
parent 4703f9f1a1
commit 58d92fe12a
2 changed files with 10 additions and 5 deletions

View file

@ -253,11 +253,13 @@ read_color_from_string (const gchar *string)
color = g_new0 (GdkColor, 1);
gdk_color_parse (string, color);
rgb = ((color->red >> 8) << 16) ||
((color->green >> 8) << 8) ||
(color->blue >> 8);
color->pixel = gdk_rgb_xpixel_from_rgb (rgb);
if (string != NULL) {
gdk_color_parse (string, color);
rgb = ((color->red >> 8) << 16) ||
((color->green >> 8) << 8) ||
(color->blue >> 8);
color->pixel = gdk_rgb_xpixel_from_rgb (rgb);
}
return color;
}