[gnome-software/gnome-3-20] trivial: Avoid a critical error if an icon failed to load



commit 26af9413419744f8d254a716ebbc9bda69fa549b
Author: Richard Hughes <richard hughsie com>
Date:   Tue Mar 1 15:50:26 2016 +0000

    trivial: Avoid a critical error if an icon failed to load

 src/gs-app-tile.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/gs-app-tile.c b/src/gs-app-tile.c
index 8b82280..5d58eb0 100644
--- a/src/gs-app-tile.c
+++ b/src/gs-app-tile.c
@@ -127,6 +127,7 @@ void
 gs_app_tile_set_app (GsAppTile *tile, GsApp *app)
 {
        const gchar *summary;
+       const GdkPixbuf *pixbuf;
 
        g_return_if_fail (GS_IS_APP_TILE (tile));
        g_return_if_fail (GS_IS_APP (app) || app == NULL);
@@ -147,7 +148,9 @@ gs_app_tile_set_app (GsAppTile *tile, GsApp *app)
                          G_CALLBACK (app_state_changed), tile);
        app_state_changed (tile->app, NULL, tile);
 
-       gs_image_set_from_pixbuf (GTK_IMAGE (tile->image), gs_app_get_pixbuf (app));
+       pixbuf = gs_app_get_pixbuf (app);
+       if (pixbuf != NULL)
+               gs_image_set_from_pixbuf (GTK_IMAGE (tile->image), pixbuf);
        gtk_label_set_label (GTK_LABEL (tile->name), gs_app_get_name (app));
        summary = gs_app_get_summary (app);
        gtk_label_set_label (GTK_LABEL (tile->summary), summary);


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