Skip to content

Commit e6da4a4

Browse files
authored
added correct validation check (dotnet#137)
1 parent d5dc0ce commit e6da4a4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Microsoft.ML.Auto/Utils/UserInputValidationUtil.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ private static void ValidateTrainData(IDataView trainData)
4646
{
4747
throw new ArgumentNullException(nameof(trainData), "Training data cannot be null");
4848
}
49-
50-
if (trainData.Schema.GetColumnOrNull(DefaultColumnNames.Features)?.Type.GetItemType() != NumberType.R4)
49+
var type = trainData.Schema.GetColumnOrNull(DefaultColumnNames.Features)?.Type.GetItemType();
50+
if (type != null && type != NumberType.R4)
5151
{
5252
throw new ArgumentException($"{DefaultColumnNames.Features} column must be of data type Single", nameof(trainData));
5353
}

0 commit comments

Comments
 (0)