Skip to content

Commit

Permalink
Merge pull request #1058 from Digitalone1/master
Browse files Browse the repository at this point in the history
Fix reading error of length property on null
  • Loading branch information
DeeDeeG authored Oct 15, 2024
2 parents 7340f4e + dad98e2 commit 1ef8b8e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/autocomplete-plus/lib/subsequence-provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,13 @@ class SubsequenceProvider {
'(){}[] :;,$@%',
this.maxResultsPerBuffer
).then(matches => {
for (let k = 0; k < matches.length; k++) {
matches[k].configSuggestion = suggestions[matches[k].positions[0].row]
// The findWordsWithSubsequence method will return `null`
// if the async work was cancelled due to the buffer being
// mutated since it was enqueued.
if (matches) {
for (let k = 0; k < matches.length; k++) {
matches[k].configSuggestion = suggestions[matches[k].positions[0].row]
}
}
return matches
})
Expand Down

0 comments on commit 1ef8b8e

Please sign in to comment.