Fix crash when searching non-table documentation
This commit is contained in:
parent
2d7c8b1ad7
commit
711c225e9c
@ -68,7 +68,8 @@ find the definition `10`, but if `opts.stop-early?` is set, it would find
|
||||
(doto opts (tset :searched-through-require true))
|
||||
(if (= 0 (length stack))
|
||||
document
|
||||
(. document.fields (. stack (length stack)))
|
||||
(and document.fields
|
||||
(. document.fields (. stack (length stack))))
|
||||
(search-document self (. document.fields (table.remove stack)) stack opts)))
|
||||
|
||||
(λ search-val [self file ast stack opts]
|
||||
|
||||
@ -118,6 +118,7 @@ new message handler `msgh`.")
|
||||
(fn test-crash []
|
||||
(check "|(local x {:foo \"hello\"}) x.foo" nil)
|
||||
(check "|\n(local x {:foo \"hello\"}) x.foo" nil)
|
||||
(check "print.my-cool-real-field|" nil)
|
||||
nil)
|
||||
|
||||
(fn test-multival []
|
||||
|
||||
Loading…
Reference in New Issue
Block a user