From 2c1838b109e71934cba7d0e0b042ec87762cbab8 Mon Sep 17 00:00:00 2001 From: Elias Meire Date: Mon, 11 Nov 2024 13:08:21 +0100 Subject: [PATCH] Prevent error being thrown in RLC while loading --- .../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 01c7b4071d22a..a4e00af9f73bd 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); + } } }