diff options
author | bptato <nincsnevem662@gmail.com> | 2023-11-29 12:37:25 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-11-29 12:37:25 +0100 |
commit | e60058104562571b20a5c6408b06dfa7d9df866b (patch) | |
tree | 6dff4a864f400af5fe05e9b576f656f93b917967 /src/server/buffer.nim | |
parent | 4a216fe8b463cd48798feb996b2a42daff7302a9 (diff) | |
download | chawan-e60058104562571b20a5c6408b06dfa7d9df866b.tar.gz |
buffer: do not set readyState if document is nil
As the comment says, buffer.document only exists if buffer.ishtml is true.
Diffstat (limited to 'src/server/buffer.nim')
-rw-r--r-- | src/server/buffer.nim | 3 |
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 |