mirror of
https://github.com/sysadminsmedia/homebox.git
synced 2025-12-21 13:23:14 +01:00
ProductBarcode: properly check array boundaries
This commit is contained in:
@@ -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 });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user