aboutsummaryrefslogtreecommitdiff
path: root/src/PriceListTools
diff options
context:
space:
mode:
authorSergey Chebotar <s.chebotar@gmail.com>2022-04-01 16:35:25 +0300
committerSergey Chebotar <s.chebotar@gmail.com>2022-04-01 16:35:25 +0300
commit4d01a456e3c5faea7a23e7e39b41e1a1bd8beef0 (patch)
tree216868fb81e8b0fbc2a657319114bdde86f26c0f /src/PriceListTools
parent7844ac52b652e30a77385b048db9b1eb4c2c9674 (diff)
Fix cast failing on non-digital value in amount field
Diffstat (limited to 'src/PriceListTools')
-rw-r--r--src/PriceListTools/SourcePriceList.cs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/PriceListTools/SourcePriceList.cs b/src/PriceListTools/SourcePriceList.cs
index d03d776..b11e060 100644
--- a/src/PriceListTools/SourcePriceList.cs
+++ b/src/PriceListTools/SourcePriceList.cs
@@ -77,9 +77,9 @@ namespace RehauSku.PriceListTools
for (int row = AmountCell.Row + 1; row <= Sheet.Cells[Sheet.Rows.Count, AmountCell.Column].End[XlDirection.xlUp].Row; row++)
{
- object amount = Sheet.Cells[row, AmountCell.Column].Value2;
+ double? amount = Sheet.Cells[row, AmountCell.Column].Value2 as double?;
- if (amount != null && (double)amount != 0)
+ if (amount != null && amount.Value != 0)
{
object group = Sheet.Cells[row, GroupCell.Column].Value2;
object name = Sheet.Cells[row, NameCell.Column].Value2;
@@ -95,12 +95,12 @@ namespace RehauSku.PriceListTools
if (PositionAmount.ContainsKey(p))
{
- PositionAmount[p] += (double)amount;
+ PositionAmount[p] += amount.Value;
}
else
{
- PositionAmount.Add(p, (double)amount);
+ PositionAmount.Add(p, amount.Value);
}
}
}