about summary refs log tree commit diff stats
path: root/src/local/container.nim
diff options
context:
space:
mode:
Diffstat (limited to 'src/local/container.nim')
-rw-r--r--src/local/container.nim4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/local/container.nim b/src/local/container.nim
index d78f9120..cc1e75e5 100644
--- a/src/local/container.nim
+++ b/src/local/container.nim
@@ -1602,8 +1602,10 @@ proc cursorToggleSelection(container: Container; n = 1;
 proc getSelectionText(container: Container; hl: Highlight = nil):
     Promise[string] {.jsfunc.} =
   if container.iface == nil:
-    return
+    return nil
   let hl = if hl == nil: container.currentSelection else: hl
+  if hl == nil:
+    return nil
   if hl.t != hltSelect:
     let p = newPromise[string]()
     p.resolve("")