summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Soriano <csoriano@gnome.org>2015-10-08 01:27:24 +0200
committerCarlos Soriano <csoriano@gnome.org>2015-10-08 01:27:24 +0200
commit745652a9f30815f3b8563bfad4c26395b8410064 (patch)
tree685f4213a82c1eef3d2c3460b53151897d3d22c3
parentdee623a8dcd84bf94f5f5395d4e0dcc27779fe78 (diff)
downloadnautilus-745652a9f30815f3b8563bfad4c26395b8410064.tar.gz
directory: protect against null filesystem type
The filesystem:type attribute could be NULL, then g_strv_contains will crash if that happens. Just don't call it if the attribute is not set.
-rw-r--r--libnautilus-private/nautilus-directory.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libnautilus-private/nautilus-directory.c b/libnautilus-private/nautilus-directory.c
index dc95998c2..29a35f95d 100644
--- a/libnautilus-private/nautilus-directory.c
+++ b/libnautilus-private/nautilus-directory.c
@@ -639,7 +639,10 @@ nautilus_directory_is_remote (NautilusDirectory *directory)
const gchar *type;
type = g_file_info_get_attribute_string (info, "filesystem::type");
- is_remote = g_strv_contains (remote_types, type);
+ if (type != NULL)
+ is_remote = g_strv_contains (remote_types, type);
+ else
+ is_remote = FALSE;
g_object_unref (info);
} else {