From c9b73ac7312774b4cfa7c40323f56b5bb9f8fdc8 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Mon, 14 Oct 2013 00:00:24 -0400 Subject: [PATCH] shell-global: Handle empty variants better In cases where we have an array of 0 elements or similar, the data returned may be NULL. Since g_file_replace_contents will assert in this case, simply check for this and delete the file instead. https://bugzilla.gnome.org/show_bug.cgi?id=710137 --- src/shell-global.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shell-global.c b/src/shell-global.c index e711dff09..99aad50b8 100644 --- a/src/shell-global.c +++ b/src/shell-global.c @@ -1770,7 +1770,7 @@ shell_global_set_runtime_state (ShellGlobal *global, path = get_runtime_state_path (global, property_name); - if (variant == NULL) + if (variant == NULL || g_variant_get_data (variant) == NULL) (void) g_file_delete (path, NULL, NULL); else {