]> Pileus Git - ~andy/gtk/commitdiff
Fix two potential critical warnings. Bug #539470.
authorCarlos Garnacho <carlos@imendio.com>
Fri, 27 Jun 2008 15:33:42 +0000 (15:33 +0000)
committerCarlos Garnacho <carlosg@src.gnome.org>
Fri, 27 Jun 2008 15:33:42 +0000 (15:33 +0000)
2008-06-27  Carlos Garnacho  <carlos@imendio.com>

        * gtk/gtkrecentmanager.c (get_icon_for_mime_type): Fix two potential
        critical warnings. Bug #539470.

svn path=/trunk/; revision=20696

ChangeLog
gtk/gtkrecentmanager.c

index 0c1b9bec493847dbce608118a6afa8359de4304c..f49b82cdc50e09ded7da68b38472a6e81deb83b6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-06-27  Carlos Garnacho  <carlos@imendio.com>
+
+       * gtk/gtkrecentmanager.c (get_icon_for_mime_type): Fix two potential
+       critical warnings. Bug #539470.
+
 2008-06-27  Emmanuele Bassi  <ebassi@gnome.org>
 
        Abstract some GdkWindow API into an interface that the backends
index 1b24425384704af0d38da64ad01efa751ab30b91..fea41ad65837dc60c6218e1dd59f118336502684 100644 (file)
@@ -1889,15 +1889,22 @@ get_icon_for_mime_type (const char *mime_type,
   icon_theme = gtk_icon_theme_get_default ();
 
   content_type = g_content_type_from_mime_type (mime_type);
+
+  if (!content_type)
+    return NULL;
+
   icon = g_content_type_get_icon (content_type);
   info = gtk_icon_theme_lookup_by_gicon (icon_theme, 
                                          icon, 
                                          pixel_size, 
                                          GTK_ICON_LOOKUP_USE_BUILTIN);
-  pixbuf = gtk_icon_info_load_icon (info, NULL);
-
   g_free (content_type);
   g_object_unref (icon);
+
+  if (!info)
+    return NULL;
+
+  pixbuf = gtk_icon_info_load_icon (info, NULL);
   gtk_icon_info_free (info);
 
   return pixbuf;