[gtk/wip/otte/for-master: 5/9] icontheme: Don't crash on icon lookup failure



commit fdd46309522f8d38d78223cf4096c3eff4f86e2c
Author: Benjamin Otte <otte redhat com>
Date:   Thu Mar 5 06:57:44 2020 +0100

    icontheme: Don't crash on icon lookup failure

 gtk/gtkicontheme.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c
index b65caad8e7..569e500f13 100644
--- a/gtk/gtkicontheme.c
+++ b/gtk/gtkicontheme.c
@@ -2209,11 +2209,12 @@ real_choose_icon (GtkIconTheme      *self,
               g_clear_object (&icon);
             }
 
-          icon->is_svg = suffix_from_name (icon->filename) == ICON_CACHE_FLAG_SVG_SUFFIX;
-          icon->is_resource = unthemed_icon->is_resource;
-
           if (icon)
-            goto out;
+            {
+              icon->is_svg = suffix_from_name (icon->filename) == ICON_CACHE_FLAG_SVG_SUFFIX;
+              icon->is_resource = unthemed_icon->is_resource;
+              goto out;
+            }
         }
     }
 


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