fix(multiselect): do not try getting label when value is undefined

Resolves https://github.com/go-vikunja/vikunja/issues/1346
This commit is contained in:
kolaente 2025-08-31 21:31:42 +02:00
parent 3baf6cd477
commit 9610ae780f
No known key found for this signature in database
GPG Key ID: F40E70337AB24C9B
1 changed files with 2 additions and 2 deletions

View File

@ -336,7 +336,7 @@ function select(object: T | null) {
}
}
function setSelectedObject(object: string | T | null, resetOnly = false) {
function setSelectedObject(object: string | T | null | undefined, resetOnly = false) {
internalValue.value = object
// We assume we're getting an array when multiple is enabled and can therefore leave the query
@ -346,7 +346,7 @@ function setSelectedObject(object: string | T | null, resetOnly = false) {
return
}
if (object === null) {
if (object === null || typeof object === 'undefined') {
query.value = ''
return
}