If the cookies tree has not been initialised do not allow operations to be scheduled upon it.

svn path=/trunk/netsurf/; revision=10868
This commit is contained in:
Vincent Sanders 2010-10-06 21:46:06 +00:00
parent e4fa546c1a
commit 45b2ab2d88

View File

@ -70,6 +70,8 @@ static struct node *cookies_find(struct node *node, const char *title)
struct node *search;
struct node_element *element;
assert(node !=NULL);
for (search = tree_node_get_child(node); search;
search = tree_node_get_next(search)) {
element = tree_node_find_element(search, TREE_ELEMENT_TITLE,
@ -408,7 +410,8 @@ bool cookies_schedule_update(const struct cookie_data *data)
assert(data != NULL);
assert(user_delete == false);
schedule(100, cookies_schedule_callback, (void *)data);
if (cookies_tree_root != NULL)
schedule(100, cookies_schedule_callback, (void *)data);
return true;
}
@ -419,7 +422,8 @@ void cookies_remove(const struct cookie_data *data)
{
assert(data != NULL);
schedule_remove(cookies_schedule_callback, (void *)data);
if (cookies_tree_root != NULL)
schedule_remove(cookies_schedule_callback, (void *)data);
}