summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Catanzaro <mcatanzaro@igalia.com>2017-07-12 18:40:19 -0500
committerMichael Catanzaro <mcatanzaro@igalia.com>2017-07-12 18:58:55 -0500
commit638a8051cd970f231126ebed7cb02bcd289cae50 (patch)
tree2bc1ec46595eb09dc151312d9afa726f0b1561ff
parent8b6ce7b8ad5f02fba58acd13bfd96f150a27891d (diff)
downloadepiphany-638a8051cd970f231126ebed7cb02bcd289cae50.tar.gz
search-engine-manager: Always return a search engine address
We need to return a default search engine address if the value in GSettings is somehow messed up. This fixes a crash if the default-search-engine and search-engines settings somehow become desynced. https://bugzilla.redhat.com/show_bug.cgi?id=1470287
-rw-r--r--lib/ephy-search-engine-manager.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/ephy-search-engine-manager.c b/lib/ephy-search-engine-manager.c
index f65110ac1..a37c76d1d 100644
--- a/lib/ephy-search-engine-manager.c
+++ b/lib/ephy-search-engine-manager.c
@@ -27,6 +27,8 @@
#include "ephy-settings.h"
#include "ephy-prefs.h"
+#define FALLBACK_ADDRESS "https://duckduckgo.com/?q=%s&t=epiphany"
+
enum {
SEARCH_ENGINES_CHANGED,
LAST_SIGNAL
@@ -145,7 +147,7 @@ ephy_search_engine_manager_get_address (EphySearchEngineManager *manager,
if (info)
return info->address;
- return NULL;
+ return FALLBACK_ADDRESS;
}
const char *