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
This commit is contained in:
parent
e0b87f1e14
commit
c9b73ac731
@ -1770,7 +1770,7 @@ shell_global_set_runtime_state (ShellGlobal *global,
|
|||||||
|
|
||||||
path = get_runtime_state_path (global, property_name);
|
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);
|
(void) g_file_delete (path, NULL, NULL);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user