[gtk+] GtkAppChooserButton: Fix a possible crash



commit ed28a71bf287165a3c48e331876a22876c5f59d9
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Jun 7 14:03:45 2014 -0400

    GtkAppChooserButton: Fix a possible crash
    
    We were not correctly dealing with content_type being NULL
    in one place.

 gtk/gtkappchooserbutton.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkappchooserbutton.c b/gtk/gtkappchooserbutton.c
index 9bdcf8b..af910c8 100644
--- a/gtk/gtkappchooserbutton.c
+++ b/gtk/gtkappchooserbutton.c
@@ -332,7 +332,8 @@ gtk_app_chooser_button_populate (GtkAppChooserButton *self)
 
   if (self->priv->show_default_item)
     {
-      default_app = g_app_info_get_default_for_type (self->priv->content_type, FALSE);
+      if (self->priv->content_type)
+        default_app = g_app_info_get_default_for_type (self->priv->content_type, FALSE);
 
       if (default_app != NULL)
         {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]