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:41:23 -0500
commit9ee69f99b48e4d384b446162b1861f8351696995 (patch)
tree2084f8f73585ef020985dfc869db9200475e5d29
parentbe9ebd36b30491eb649ad074890ba607408b524e (diff)
downloadepiphany-9ee69f99b48e4d384b446162b1861f8351696995.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 *