[gnome-software/wip/kalev/merge-after-freeze: 3/4] update dialog: Fix a critical when showing packages with no icon



commit 4aafaa1a10355270ca2cd1776de8206c13623abd
Author: Kalev Lember <kalevlember gmail com>
Date:   Thu Mar 19 23:35:47 2015 +0100

    update dialog: Fix a critical when showing packages with no icon

 src/gs-update-dialog.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/src/gs-update-dialog.c b/src/gs-update-dialog.c
index f13f97b..eed2774 100644
--- a/src/gs-update-dialog.c
+++ b/src/gs-update-dialog.c
@@ -91,6 +91,7 @@ set_updates_description_ui (GsUpdateDialog *dialog, GsApp *app)
 {
        GsUpdateDialogPrivate *priv = gs_update_dialog_get_instance_private (dialog);
        GsAppKind kind;
+       const GdkPixbuf *pixbuf;
        const gchar *update_details;
        _cleanup_free_ gchar *update_desc = NULL;
 
@@ -123,10 +124,13 @@ set_updates_description_ui (GsUpdateDialog *dialog, GsApp *app)
        /* set update header */
        gtk_widget_set_visible (priv->box_header, kind == GS_APP_KIND_NORMAL || kind == GS_APP_KIND_SYSTEM);
        gtk_label_set_markup (GTK_LABEL (priv->label_details), update_desc);
-       gs_image_set_from_pixbuf (GTK_IMAGE (priv->image_icon), gs_app_get_pixbuf (app));
        gtk_label_set_label (GTK_LABEL (priv->label_name), gs_app_get_name (app));
        gtk_label_set_label (GTK_LABEL (priv->label_summary), gs_app_get_summary (app));
 
+       pixbuf = gs_app_get_pixbuf (app);
+       if (pixbuf != NULL)
+               gs_image_set_from_pixbuf (GTK_IMAGE (priv->image_icon), pixbuf);
+
        /* show the back button if needed */
        gtk_widget_set_visible (priv->button_back, !g_queue_is_empty (priv->back_entry_stack));
 }


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