Fix off-by-one error in sendLowStockAlerts loop

Fixes #1751
This commit is contained in:
2026-05-26 14:22:41 +05:30
parent fb509ccb3f
commit 5fd0a47459
@@ -80,7 +80,7 @@ void InventoryManagementService::sendLowStockAlerts()
{
throw std::runtime_error("The system has no admins present!");
}
for (int index = 0; index <= inventoryItemsSize; index++)
for (int index = 0; index < inventoryItemsSize; index++)
{
InventoryItem* inventoryItem = inventoryItems.getValueAt(index);
if (inventoryItem && inventoryItem->getQuantity() < config::threshold::INVENTORY_LOW_STOCK_THRESHOLD)