With C#8 and null reference turn on, I now get this warning, item is highlighted with Converting null literal or possible null value to non nullable type. The Class rtGirdProp has no non nullable items. How do I fix this?
enter code here
foreach (rtGridProp item in items)
{
shares = shares + item.rtTotalShare;
totalPrice = totalPrice + (item.rtTotalShare * item.rtAverage);
}
if (shares == 0)
this.AveragePrice = 0;
else
this.AveragePrice = totalPrice / shares;