diff options
author | Xan Lopez <xan@igalia.com> | 2012-03-07 22:56:23 +0800 |
---|---|---|
committer | Xan Lopez <xan@igalia.com> | 2012-03-07 22:56:23 +0800 |
commit | 2bcc70a27132a5959dac7d03531ebaf3435f4e5e (patch) | |
tree | 6e6e606d04a4ca14e07c5629a48ad83f1254d1ae | |
parent | 25f8048d25b043b5a4a58b9c567754dd5cfc9417 (diff) | |
download | gsoc2013-epiphany-2bcc70a27132a5959dac7d03531ebaf3435f4e5e.tar.gz gsoc2013-epiphany-2bcc70a27132a5959dac7d03531ebaf3435f4e5e.tar.zst gsoc2013-epiphany-2bcc70a27132a5959dac7d03531ebaf3435f4e5e.zip |
ephy-history-service-urls-table: do not g_assert on input
Simply bail out and don't crash the browser.
-rw-r--r-- | lib/history/ephy-history-service-urls-table.c | 8 |
1 files 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=?"); |