mirror of
https://github.com/overleaf/overleaf.git
synced 2025-02-25 00:31:36 +00:00
guard against null and undefined keys in \cite{}
autocomplete
This commit is contained in:
parent
34bfdcc246
commit
b005f8233e
1 changed files with 7 additions and 6 deletions
|
@ -66,12 +66,13 @@ define [
|
|||
}
|
||||
if references.keys and references.keys.length > 0
|
||||
references.keys.forEach (key) ->
|
||||
result.push({
|
||||
caption: "\\#{commandName}{#{previousArgsCaption}#{key}",
|
||||
value: "\\#{commandName}{#{previousArgs}#{key}",
|
||||
meta: "reference",
|
||||
score: 10000
|
||||
})
|
||||
if !(key in [null, undefined])
|
||||
result.push({
|
||||
caption: "\\#{commandName}{#{previousArgsCaption}#{key}",
|
||||
value: "\\#{commandName}{#{previousArgs}#{key}",
|
||||
meta: "reference",
|
||||
score: 10000
|
||||
})
|
||||
callback null, result
|
||||
else
|
||||
callback null, result
|
||||
|
|
Loading…
Reference in a new issue