From e09133f1e06ffef877b37a4f4cb03a69137db62f Mon Sep 17 00:00:00 2001 From: Benjamin CHARMES Date: Wed, 25 Sep 2024 10:54:43 +0100 Subject: [PATCH] Fix this.value == null inside CreateItemModal insert into collection --- webapp/src/components/CollectionSelect.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/webapp/src/components/CollectionSelect.vue b/webapp/src/components/CollectionSelect.vue index 2e3341d7e..7f50cccef 100644 --- a/webapp/src/components/CollectionSelect.vue +++ b/webapp/src/components/CollectionSelect.vue @@ -75,10 +75,12 @@ export default { }, }, collectionOrNewCollection() { + const valueSafe = Array.isArray(this.value) ? this.value : []; + if ( this.searchQuery && !this.collections.some((item) => item.collection_id === this.searchQuery) && - !this.value.some((item) => item.collection_id === this.searchQuery) + !valueSafe.some((item) => item.collection_id === this.searchQuery) ) { return [ ...this.collections,