Mögliches Nullreferenzargument für Parameter „item“ in „void List.Add(object item)“
Dies ist der Code und die Warnung wird in diesen Zeilen angezeigt
Code: Select all
rowDataList = [.. rowCollection[headRow].ItemArray];
Code: Select all
DataSet dataSet = reader.AsDataSet(conf);
DataRowCollection rowCollection;
if (checkData == 0)
rowCollection = dataSet.Tables[sheetName].Rows;
else
rowCollection = dataSet.Tables[0].Rows;
int rowCount = rowCollection.Count;
if (rowCollection != null && rowCollection.Count > headRow)
{
rowDataList = [.. rowCollection[headRow].ItemArray];
await AssertIsTrue(rowCount != 0, $"Assert there are rows in the report file, the count is {rowCollection.Count}");
if (rowNumb != 0)
await AssertIsTrue(rowCount - 1 == rowNumb, $"Assert there are rows in the report file match the page, the count is {rowCollection.Count}");
//now check the first row is correct
await TopIsGoodCheck(topRow, rowDataList);
if (checkData != 0)
await CheckForData(checkData, rowCollection);
if (dataColumns != null && rowCollection.Count > 1)
{
rowDataList = [.. rowCollection[1].ItemArray];
await DataColumnsCheck(rowDataList, dataColumns);
}
}
Mobile version