From 2bcc70a27132a5959dac7d03531ebaf3435f4e5e Mon Sep 17 00:00:00 2001 From: Xan Lopez Date: Wed, 7 Mar 2012 15:56:23 +0100 Subject: ephy-history-service-urls-table: do not g_assert on input Simply bail out and don't crash the browser. --- lib/history/ephy-history-service-urls-table.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/history/ephy-history-service-urls-table.c b/lib/history/ephy-history-service-urls-table.c index 75d98ea0c..7b95c03aa 100644 --- a/lib/history/ephy-history-service-urls-table.c +++ b/lib/history/ephy-history-service-urls-table.c @@ -61,10 +61,10 @@ ephy_history_service_get_url_row (EphyHistoryService *self, const char *url_stri g_assert (priv->history_thread == g_thread_self ()); g_assert (priv->history_database != NULL); - if (url_string == NULL && url != NULL) { + if (url_string == NULL && url != NULL) url_string = url->url; - } - g_assert (url_string || url->id != -1); + + g_return_val_if_fail (url_string || url->id != -1, NULL); if (url != NULL && url->id != -1) { statement = ephy_sqlite_connection_create_statement (priv->history_database, @@ -364,7 +364,7 @@ ephy_history_service_delete_url (EphyHistoryService *self, EphyHistoryURL *url) g_assert (priv->history_thread == g_thread_self ()); g_assert (priv->history_database != NULL); - g_assert (url->id != -1 || url->url); + g_return_if_fail (url->id != -1 || url->url); if (url->id != -1) sql_statement = g_strdup ("DELETE FROM urls WHERE id=?"); -- cgit v1.2.3