summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2013-07-25 11:45:07 +0100
committerMichael Drake <tlsa@netsurf-browser.org>2013-07-25 11:45:07 +0100
commitba576ad5d6c7aa808dee631643a8ac878d3205cc (patch)
tree10902c946beedf2106c705d10c12efcde8ba5ca3 /desktop
parenta399e5aa703420854175d14a62b6a8edb3ba0c18 (diff)
downloadnetsurf-ba576ad5d6c7aa808dee631643a8ac878d3205cc.tar.gz
netsurf-ba576ad5d6c7aa808dee631643a8ac878d3205cc.tar.bz2
Guard for uninitalised history case.
Diffstat (limited to 'desktop')
-rw-r--r--desktop/global_history.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/desktop/global_history.c b/desktop/global_history.c
index bfafe695e..b9a575468 100644
--- a/desktop/global_history.c
+++ b/desktop/global_history.c
@@ -809,6 +809,10 @@ nserror global_history_add(nsurl *url)
{
const struct url_data *data;
+ /* If we don't have a global history at the moment, just return OK */
+ if (gh_ctx.tree == NULL)
+ return NSERROR_OK;
+
data = urldb_get_url_data(url);
if (data == NULL) {
LOG(("Can't add URL to history that's not present in urldb."));