[gnome-shell: 9/11] shell-global: Handle empty variants better



commit c9b73ac7312774b4cfa7c40323f56b5bb9f8fdc8
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Mon Oct 14 00:00:24 2013 -0400

    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 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/shell-global.c b/src/shell-global.c
index e711dff..99aad50 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
     {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]