[gnome-shell/wip/gtk-notification: 36/40] shell-global: Handle empty	variants better
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc: 
- Subject: [gnome-shell/wip/gtk-notification: 36/40] shell-global: Handle empty	variants better
- Date: Mon, 21 Oct 2013 17:18:08 +0000 (UTC)
commit 2971f7297658f423b7fe1e05a7b1c75f3c271bf7
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]