[gnome-software] trivial: Avoid a critical error if an icon failed to load
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] trivial: Avoid a critical error if an icon failed to load
- Date: Tue, 1 Mar 2016 15:58:30 +0000 (UTC)
commit 4c37358ec1549be25c20fceb3c6a2af8cf8da961
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 9e01f76..d649c2b 100644
--- a/src/gs-app-tile.c
+++ b/src/gs-app-tile.c
@@ -128,6 +128,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);
@@ -156,7 +157,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]