ProductBarcode: properly check array boundaries

This commit is contained in:
Crumb Owl
2025-07-19 23:04:56 +02:00
parent a57b83c52d
commit 7129650efa

View File

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