[balsa/wip/gtk4] Continue when icons are missing



commit 1545b9b77ad43a8348ecc3175993c1adef897340
Author: Pawel Salek <pawsa0 gmail com>
Date:   Fri Jun 1 06:29:37 2018 +0100

    Continue when icons are missing
    
    * src/balsa-icons.c: don't let missing icons stop balsa.

 ChangeLog         | 4 ++++
 src/balsa-icons.c | 6 +++++-
 2 files changed, 9 insertions(+), 1 deletion(-)
---
diff --git a/ChangeLog b/ChangeLog
index 236329a4..3fdfb812 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2018-06-01  Pawel Salek  <pawsa0 gmail com>
+
+       * src/balsa-icons.c: don't let missing icons stop balsa.
+
 2018-05-31  Peter Bloomfield  <pbloomfield bellsouth net>
 
        Use g_strcmp0() for NULL-safe comparisons
diff --git a/src/balsa-icons.c b/src/balsa-icons.c
index 89bb5578..c3f02758 100644
--- a/src/balsa-icons.c
+++ b/src/balsa-icons.c
@@ -76,8 +76,12 @@ load_balsa_pixmap(GtkIconTheme *icon_theme, const balsa_pixmap_t *bpixmap)
      * alternative name if not */
     if (!gtk_icon_theme_has_icon(icon_theme, bpixmap->stock_id)) {
        pixmap_fallback_t *fb = fallback_id;
-       while (g_strcmp0(fb->def_id, bpixmap->stock_id) != 0)
+       while (fb->def_id && g_strcmp0(fb->def_id, bpixmap->stock_id) != 0)
            fb++;
+       if (!fb->def_id) {
+           BICONS_LOG("No GTK or custom icon for %s\n", bpixmap);
+           return;
+       }
        if (fb->def_id) {
            use_id = fb->fb_id;
             BICONS_LOG("\t(%s not found, fall back to %s)",


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