Prevent error being thrown in RLC while loading

This commit is contained in:
Elias Meire 2024-11-11 13:08:21 +01:00
parent c0aa67b8f0
commit 2c1838b109
No known key found for this signature in database

View file

@ -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);
}
}
}