about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-03-24 21:59:24 +0100
committerbptato <nincsnevem662@gmail.com>2024-03-24 21:59:24 +0100
commit00fa87199d70f5717446a32c04026880eccbbefa (patch)
tree1a9a8829ed64f48571b6c7638aa40e513f9f22d6 /src
parentb03e646012739b2bd1444604504a869d7b252323 (diff)
downloadchawan-00fa87199d70f5717446a32c04026880eccbbefa.tar.gz
buffer: fix getTitle never returning in some cases
Diffstat (limited to 'src')
-rw-r--r--src/server/buffer.nim2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/server/buffer.nim b/src/server/buffer.nim
index 13a7ea20..ddd85420 100644
--- a/src/server/buffer.nim
+++ b/src/server/buffer.nim
@@ -1159,6 +1159,8 @@ proc getTitle*(buffer: Buffer): string {.proxy, task.} =
     let title = buffer.document.findFirst(TAG_TITLE)
     if title != nil:
       return title.childTextContent.stripAndCollapse()
+    if buffer.state == bsLoaded:
+      return "" # title no longer expected
   buffer.savetask = true
   return ""