about summary refs log tree commit diff stats
path: root/src/server/buffer.nim
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/buffer.nim')
-rw-r--r--src/server/buffer.nim3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/server/buffer.nim b/src/server/buffer.nim
index 82774fe7..127e0967 100644
--- a/src/server/buffer.nim
+++ b/src/server/buffer.nim
@@ -1137,7 +1137,8 @@ proc onload(buffer: Buffer) =
       res.atend = true
       buffer.finishLoad().then(proc() =
         buffer.state = LOADED
-        buffer.document.readyState = READY_STATE_COMPLETE
+        if buffer.document != nil: # may be nil if not buffer.ishtml
+          buffer.document.readyState = READY_STATE_COMPLETE
         buffer.dispatchLoadEvent()
         buffer.resolveTask(LOAD, res))
       return