[epiphany/wip/sync: 83/86] bookmark: Fix criticals caused by non-existent tags
- From: Gabriel Ivașcu <gabrielivascu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/wip/sync: 83/86] bookmark: Fix criticals caused by non-existent tags
- Date: Tue, 28 Mar 2017 21:00:53 +0000 (UTC)
commit f2b1ab3df5d1969eeb0412e29d9a06df28f632d1
Author: Gabriel Ivascu <ivascu gabriel59 gmail com>
Date: Fri Mar 24 22:04:42 2017 +0200
bookmark: Fix criticals caused by non-existent tags
src/bookmarks/ephy-bookmark.c | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/src/bookmarks/ephy-bookmark.c b/src/bookmarks/ephy-bookmark.c
index b3a8317..38f7723 100644
--- a/src/bookmarks/ephy-bookmark.c
+++ b/src/bookmarks/ephy-bookmark.c
@@ -189,7 +189,8 @@ ephy_bookmark_finalize (GObject *object)
g_free (self->title);
g_free (self->id);
- g_sequence_free (self->tags);
+ if (self->tags)
+ g_sequence_free (self->tags);
G_OBJECT_CLASS (ephy_bookmark_parent_class)->finalize (object);
}
@@ -304,10 +305,12 @@ ephy_bookmark_json_serializable_serialize_property (JsonSerializable *serializab
array = json_array_new ();
tags = g_value_get_pointer (value);
- for (iter = g_sequence_get_begin_iter (tags);
- !g_sequence_iter_is_end (iter);
- iter = g_sequence_iter_next (iter)) {
- json_array_add_string_element (array, g_sequence_get (iter));
+ if (tags != NULL) {
+ for (iter = g_sequence_get_begin_iter (tags);
+ !g_sequence_iter_is_end (iter);
+ iter = g_sequence_iter_next (iter)) {
+ json_array_add_string_element (array, g_sequence_get (iter));
+ }
}
json_node_set_array (node, array);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]