From b2abf3de9e1f8f91c9ee6a1ec9a05da7575f5805 Mon Sep 17 00:00:00 2001 From: Jacob Page <85361835+jpage-godaddy@users.noreply.github.com> Date: Mon, 18 Mar 2024 02:29:50 -0700 Subject: [PATCH] fix: autocompletion sometimes throwing an error when there are no suggestions Fix the bug where we get this uncaught error: > TypeError: reduce of empty array with no initial value --- src/js/SchemaTextCompleter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/SchemaTextCompleter.js b/src/js/SchemaTextCompleter.js index c0649a2a..ac3d98b8 100644 --- a/src/js/SchemaTextCompleter.js +++ b/src/js/SchemaTextCompleter.js @@ -178,7 +178,7 @@ export class SchemaTextCompleter { } } return last - }) + }, null) if (typeof option === 'string') { if (currentSuggestions[option]?.refs?.length) { const mergedSuggestions = {}