Exit loop if first search returns nothing

This commit is contained in:
Sergey Chebotar 2022-01-28 12:33:21 +03:00
parent 952ca22316
commit aea6e224c2

View File

@ -39,6 +39,12 @@ namespace RehauSku.PriceListTools
foreach (var kvp in dictionary) foreach (var kvp in dictionary)
{ {
Range foundCell = TargetFile.skuCell.EntireColumn.Find(kvp.Key.Sku); Range foundCell = TargetFile.skuCell.EntireColumn.Find(kvp.Key.Sku);
if (foundCell == null)
{
missing.Add(kvp);
continue;
}
string foundCellGroup = groupColumn[foundCell.Row, 1].ToString(); string foundCellGroup = groupColumn[foundCell.Row, 1].ToString();
while (foundCell != null && foundCellGroup != kvp.Key.Group) while (foundCell != null && foundCellGroup != kvp.Key.Group)