Fix crash when building error page -- fetch will be NULL, so fetch_get_referer will fail.

svn path=/trunk/netsurf/; revision=3476
This commit is contained in:
John Mark Bell 2007-08-06 22:17:04 +00:00
parent c1531c449f
commit 81f3fcbafd
2 changed files with 4 additions and 1 deletions

View File

@ -564,7 +564,8 @@ bool content_set_type(struct content *c, content_type type,
c->user_list->next->next) {
/* type not shareable, and more than one user: split into
* a content per user */
const char *referer = fetch_get_referer(c->fetch);
const char *referer =
c->fetch ? fetch_get_referer(c->fetch) : NULL;
while (c->user_list->next->next) {
clone = content_create(c->url);

View File

@ -533,6 +533,8 @@ long fetch_http_code(struct fetch *fetch)
*/
const char *fetch_get_referer(struct fetch *fetch)
{
assert(fetch);
return fetch->referer;
}