[baobab] Fix a warning about unhandled exception



commit 489a122f285052b628ff58601ebd7ca24e080a33
Author: Paolo Borelli <pborelli gnome org>
Date:   Mon Apr 9 15:10:44 2012 +0200

    Fix a warning about unhandled exception

 src/baobab-location-widget.vala |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/src/baobab-location-widget.vala b/src/baobab-location-widget.vala
index 632597c..727cbdd 100644
--- a/src/baobab-location-widget.vala
+++ b/src/baobab-location-widget.vala
@@ -49,9 +49,14 @@ namespace Baobab {
 
             var icon_theme = Gtk.IconTheme.get_default ();
             var icon_info = icon_theme.lookup_by_gicon (location.icon, 64, 0);
-            var pixbuf = icon_info.load_icon ();
-            var image = new Gtk.Image.from_pixbuf (pixbuf);
-            add (image);
+
+            try {
+                var pixbuf = icon_info.load_icon ();
+                var image = new Gtk.Image.from_pixbuf (pixbuf);
+                add (image);
+            } catch (Error e) {
+                warning ("Failed to load icon %s: %s", location.icon.to_string(), e.message);
+            }
 
             var label = new Gtk.Label (location.name);
             label.xalign = 0;



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