diff --git a/src/ecmascript/spidermonkey/document.c b/src/ecmascript/spidermonkey/document.c index 6a6ec1375..4108d7242 100644 --- a/src/ecmascript/spidermonkey/document.c +++ b/src/ecmascript/spidermonkey/document.c @@ -510,7 +510,7 @@ document_write_do(JSContext *ctx, unsigned int argc, JS::Value *rval, int newlin struct cache_entry *cached = doc_view->document->cached; cached = doc_view->document->cached; struct fragment *f = get_cache_fragment(cached); - struct string buffer = INIT_STRING("", 0); + if (f && f->length) { int code_len=code.length;