From ca8cb455ba59831295c238afb11aeab6ad18428e Mon Sep 17 00:00:00 2001 From: Elias Meire Date: Wed, 13 Nov 2024 14:47:27 +0100 Subject: [PATCH] fix(editor): Prevent error being thrown in RLC while loading (#11676) --- .../components/ResourceLocator/ResourceLocatorDropdown.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/editor-ui/src/components/ResourceLocator/ResourceLocatorDropdown.vue b/packages/editor-ui/src/components/ResourceLocator/ResourceLocatorDropdown.vue index 01c7b4071d..a4e00af9f7 100644 --- a/packages/editor-ui/src/components/ResourceLocator/ResourceLocatorDropdown.vue +++ b/packages/editor-ui/src/components/ResourceLocator/ResourceLocatorDropdown.vue @@ -145,7 +145,12 @@ function onKeyDown(e: KeyboardEvent) { } } } else if (e.key === 'Enter') { - emit('update:modelValue', sortedResources.value[hoverIndex.value].value); + const selected = sortedResources.value[hoverIndex.value]?.value; + + // Selected resource can be empty when loading or empty results + if (selected) { + emit('update:modelValue', selected); + } } }