[balsa/wip/gtk4] balsa-message: check for NULL return
- From: Peter Bloomfield <peterb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [balsa/wip/gtk4] balsa-message: check for NULL return
- Date: Sat, 28 Sep 2019 17:52:31 +0000 (UTC)
commit 158666c9ed8da6af1e5c2b5c9ff530f8883aca75
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date: Sat Sep 28 13:51:27 2019 -0400
balsa-message: check for NULL return
from gtk_icon_theme_load_icon()
src/balsa-message.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/src/balsa-message.c b/src/balsa-message.c
index 214b91971..5fed6067c 100644
--- a/src/balsa-message.c
+++ b/src/balsa-message.c
@@ -2693,7 +2693,7 @@ get_crypto_content_icon(LibBalsaMessageBody * body, const gchar * content_type,
gchar ** icon_title)
{
GdkPaintable *paintable;
- GdkPixbuf *icon;
+ GdkPixbuf *icon = NULL;
gchar * new_title;
const gchar * icon_name;
gpgme_error_t status;
@@ -2709,8 +2709,10 @@ get_crypto_content_icon(LibBalsaMessageBody * body, const gchar * content_type,
paintable =
gtk_icon_theme_load_icon(gtk_icon_theme_get_default(), icon_name, 24, 0, NULL);
- icon = gdk_pixbuf_get_from_texture(GDK_TEXTURE(paintable));
- g_object_unref(paintable);
+ if (paintable != NULL) {
+ icon = gdk_pixbuf_get_from_texture(GDK_TEXTURE(paintable));
+ g_object_unref(paintable);
+ }
if (!icon_title)
return icon;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]