[gnome-shell/wip/gtk-notification: 20/22] 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: 20/22] shell-global: Handle empty variants better
- Date: Mon, 14 Oct 2013 13:55:19 +0000 (UTC)
commit ca1d89a090263b6d511c2f1e60cead86c1109180
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.
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 95787a5..68773b8 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]