Guard for uninitalised history case.

This commit is contained in:
Michael Drake 2013-07-25 11:45:07 +01:00
parent a399e5aa70
commit ba576ad5d6
1 changed files with 4 additions and 0 deletions

View File

@ -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."));