[nautilus] pathbar: don't assume a mounted mount is always available



commit 9a122cb3aa4f85548ff036ea3e6509e0e60387f8
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Fri Oct 19 16:36:48 2012 -0400

    pathbar: don't assume a mounted mount is always available
    
    We might be refreshing while the mount disappears; in that case, the
    pathbar will try to get a symbolic icon from a NULL mount, hitting an
    assertion.

 src/nautilus-pathbar.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/nautilus-pathbar.c b/src/nautilus-pathbar.c
index 0ec082b..5802001 100644
--- a/src/nautilus-pathbar.c
+++ b/src/nautilus-pathbar.c
@@ -1298,9 +1298,13 @@ get_gicon_for_mount (ButtonData *button_data)
 	GIcon *icon;
 	GMount *mount;
 
+	icon = NULL;
 	mount = nautilus_get_mounted_mount_for_root (button_data->path);
-	icon = g_mount_get_symbolic_icon (mount);
-	g_object_unref (mount);
+
+	if (mount != NULL) {
+		icon = g_mount_get_symbolic_icon (mount);
+		g_object_unref (mount);
+	}
 
 	return icon;
 }



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