diff --git a/libnautilus-private/nautilus-query.c b/libnautilus-private/nautilus-query.c
index 392aea3..3457df4 100644
--- a/libnautilus-private/nautilus-query.c
+++ b/libnautilus-private/nautilus-query.c
@@ -307,6 +307,11 @@ nautilus_query_load (char *file)
 	
 
 	g_file_get_contents (file, &xml, &xml_len, NULL);
+
+	if (xml_len == 0) {
+		return NULL;
+	}
+
 	query = nautilus_query_parse_xml (xml, xml_len);
 	g_free (xml);
 
