From 74549eff9d65c9c435949adc11b695cb88d4280d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Pawe=C5=82=20Forysiuk?= Date: Thu, 17 Feb 2011 20:18:18 +0100 Subject: [PATCH] Handle NULL desc in midori_bookmarks_insert_item_db --- panels/midori-bookmarks.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/panels/midori-bookmarks.c b/panels/midori-bookmarks.c index b66c542a..801c5fd8 100644 --- a/panels/midori-bookmarks.c +++ b/panels/midori-bookmarks.c @@ -243,6 +243,7 @@ midori_bookmarks_insert_item_db (sqlite3* db, KatzeItem* old_parent; gchar* parent; gchar* uri; + gchar* desc; /* Bookmarks must have a name, import may produce invalid items */ g_return_if_fail (katze_item_get_name (item)); @@ -252,6 +253,11 @@ midori_bookmarks_insert_item_db (sqlite3* db, else uri = g_strdup (""); + if (katze_item_get_text (item)) + desc = g_strdup (katze_item_get_text (item)); + else + desc = g_strdup (""); + /* Use folder, otherwise fallback to parent folder */ old_parent = katze_item_get_parent (item); if (folder && *folder) @@ -266,7 +272,7 @@ midori_bookmarks_insert_item_db (sqlite3* db, " ('%q', '%q', '%q', '%q', %d, %d)", uri, katze_item_get_name (item), - katze_item_get_text (item), + desc, parent, katze_item_get_meta_boolean (item, "toolbar"), katze_item_get_meta_boolean (item, "app")); @@ -279,6 +285,7 @@ midori_bookmarks_insert_item_db (sqlite3* db, g_free (uri); g_free (parent); + g_free (desc); sqlite3_free (sqlcmd); } -- 2.39.5