[PATCH] Don't call gnome_vfs_volume_monitor_get_volume_for_path with NULL path



Proposed patch attached.

-- 
Christian Neumair <chris gnome-de org>
Index: libnautilus-private/nautilus-file.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-file.c,v
retrieving revision 1.391
diff -u -p -r1.391 nautilus-file.c
--- libnautilus-private/nautilus-file.c	27 Sep 2006 16:02:39 -0000	1.391
+++ libnautilus-private/nautilus-file.c	8 Oct 2006 10:53:37 -0000
@@ -5115,9 +5115,13 @@ nautilus_file_get_volume_name (NautilusF
 	char *volume_name;
 	GnomeVFSVolume *volume;
 	file_uri = nautilus_file_get_uri (file);
-	
+
+	volume = NULL;
+
 	local_path = gnome_vfs_get_local_path_from_uri (file_uri);
-	volume = gnome_vfs_volume_monitor_get_volume_for_path (gnome_vfs_get_volume_monitor (), local_path);
+	if (local_path != NULL) {
+		volume = gnome_vfs_volume_monitor_get_volume_for_path (gnome_vfs_get_volume_monitor (), local_path);
+	}
 	
 	g_free (file_uri);
 	g_free (local_path);
Index: libnautilus-private/nautilus-monitor.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-monitor.c,v
retrieving revision 1.23
diff -u -p -r1.23 nautilus-monitor.c
--- libnautilus-private/nautilus-monitor.c	5 Nov 2003 16:19:54 -0000	1.23
+++ libnautilus-private/nautilus-monitor.c	8 Oct 2006 10:53:41 -0000
@@ -73,6 +73,8 @@ path_is_on_readonly_volume (const char *
 	GnomeVFSVolume *volume;
 	gboolean res;
 
+	g_assert (path != NULL);
+
 	volume_monitor = gnome_vfs_get_volume_monitor ();
 	volume = gnome_vfs_volume_monitor_get_volume_for_path (volume_monitor, 
 							       path);


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