Skip to content

Commit

Permalink
fix: autocompletion sometimes throwing an error when there are no sug…
Browse files Browse the repository at this point in the history
…gestions

Fix the bug where we get this uncaught error:

> TypeError: reduce of empty array with no initial value
  • Loading branch information
jpage-godaddy committed Mar 18, 2024
1 parent dd6f649 commit b2abf3d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/js/SchemaTextCompleter.js
Expand Up @@ -178,7 +178,7 @@ export class SchemaTextCompleter {
}
}
return last
})
}, null)
if (typeof option === 'string') {
if (currentSuggestions[option]?.refs?.length) {
const mergedSuggestions = {}
Expand Down

0 comments on commit b2abf3d

Please sign in to comment.