diff --git a/frontend/components/Item/BarcodeModal.vue b/frontend/components/Item/BarcodeModal.vue index f2deee7f..006270f8 100644 --- a/frontend/components/Item/BarcodeModal.vue +++ b/frontend/components/Item/BarcodeModal.vue @@ -173,7 +173,12 @@ const api = useUserApi(); function createItem() { - if (products !== null) { + if ( + products.value !== null && + products.value.length > 0 && + selectedRow.value >= 0 && + selectedRow.value < products.value.length + ) { const p = products.value![selectedRow.value]; openDialog(DialogID.CreateItem, { product: p }); }