summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorrec <44084068+recloser@users.noreply.github.com>2019-01-04 15:05:03 +0100
committerAndreas Rumpf <rumpf_a@web.de>2019-01-04 15:05:03 +0100
commitba7d33b4e46f9eafb4980f7a2b4865c5914e0fcc (patch)
treed1e004f28c7f9c6f70b4bb243e58e74e07673305 /lib
parent4eee92a7a3741a2783b49dd74c11551cffc5518a (diff)
downloadNim-ba7d33b4e46f9eafb4980f7a2b4865c5914e0fcc.tar.gz
Guard against null exception (#10162)
Diffstat (limited to 'lib')
-rw-r--r--lib/system/jssys.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/system/jssys.nim b/lib/system/jssys.nim
index 8be19e5b8..d7718e4f4 100644
--- a/lib/system/jssys.nim
+++ b/lib/system/jssys.nim
@@ -46,7 +46,7 @@ proc nimCharToStr(x: char): string {.compilerproc.} =
   result[0] = x
 
 proc isNimException(): bool {.asmNoStackFrame.} =
-  asm "return `lastJSError`.m_type;"
+  asm "return `lastJSError` && `lastJSError`.m_type;"
 
 proc getCurrentException*(): ref Exception {.compilerRtl, benign.} =
   if isNimException(): result = cast[ref Exception](lastJSError)