Check for NULL path before calling

2006-10-19  Christian Neumair  <chris@gnome-de.org>

	* libnautilus-private/nautilus-file.c:
	(nautilus_file_get_volume_name):
	Check for NULL path before calling
	gnome_vfs_volume_monitor_get_volume_for_path().

	* libnautilus-private/nautilus-monitor.c:
	(path_is_on_readonly_volume):
	Assert path.
This commit is contained in:
Christian Neumair 2006-10-19 14:31:33 +00:00 committed by Christian Neumair
parent 34854513aa
commit 479b32f554
3 changed files with 19 additions and 2 deletions

View file

@ -1,3 +1,14 @@
2006-10-19 Christian Neumair <chris@gnome-de.org>
* libnautilus-private/nautilus-file.c:
(nautilus_file_get_volume_name):
Check for NULL path before calling
gnome_vfs_volume_monitor_get_volume_for_path().
* libnautilus-private/nautilus-monitor.c:
(path_is_on_readonly_volume):
Assert path.
2006-10-19 Christian Neumair <chris@gnome-de.org>
* src/file-manager/fm-directory-view.c:

View file

@ -5115,9 +5115,13 @@ nautilus_file_get_volume_name (NautilusFile *file)
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);

View file

@ -73,6 +73,8 @@ path_is_on_readonly_volume (const char *path)
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);