[eog] Fix critical warnings in last commit



commit bc010e9885f3be9f50f37366e4f6fd6910c103db
Author: Felix Riemann <friemann gnome org>
Date:   Mon Aug 24 17:59:25 2009 +0200

    Fix critical warnings in last commit
    
    Avoids critical warnings because we forgot that g_app_info_get_icon
    can return NULL in commit 7bba458.

 src/eog-window.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/src/eog-window.c b/src/eog-window.c
index beaada1..3ab58e8 100644
--- a/src/eog-window.c
+++ b/src/eog-window.c
@@ -1181,11 +1181,15 @@ eog_window_update_openwith_menu (EogWindow *window, EogImage *image)
 
                 label = g_strdup (g_app_info_get_name (app));
                 tip = g_strdup_printf (_("Use \"%s\" to open the selected image"), g_app_info_get_name (app));
-                app_icon = g_object_ref (g_app_info_get_icon (app));
+
                 action = gtk_action_new (name, label, tip, NULL);
 
-                gtk_action_set_gicon (action, app_icon);
-                g_object_unref (app_icon);
+		app_icon = g_app_info_get_icon (app);
+		if (G_LIKELY (app_icon != NULL)) {
+			g_object_ref (app_icon);
+                	gtk_action_set_gicon (action, app_icon);
+                	g_object_unref (app_icon);
+		}
 
                 g_free (label);
                 g_free (tip);



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