[alacarte] util: avoid crashing if a .desktop file has no icon defined



commit 10a804414444ce0ab78c9d131c9945e18f559547
Author: Alexandre Rostovtsev <tetromino gentoo org>
Date:   Thu May 24 00:04:55 2012 -0400

    util: avoid crashing if a .desktop file has no icon defined
    
    https://bugzilla.gnome.org/show_bug.cgi?id=676700

 Alacarte/util.py |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/Alacarte/util.py b/Alacarte/util.py
index 8501a35..cc7d136 100644
--- a/Alacarte/util.py
+++ b/Alacarte/util.py
@@ -139,6 +139,9 @@ def getIcon(item):
         app_info = item.get_app_info()
         gicon = app_info.get_icon()
 
+    if gicon is None:
+        return None
+
     icon_theme = Gtk.IconTheme.get_default()
     info = icon_theme.lookup_by_gicon(gicon, 24, 0)
     if info is None:



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