Skip to content

Commit

Permalink
[c++][fix] check nullable of bin mappers in dataset_loader.cpp (fix m…
Browse files Browse the repository at this point in the history
…icrosoft#5221) (microsoft#5258)

check nullable of bin mappers
  • Loading branch information
shiyu1994 authored Jun 2, 2022
1 parent 4971a06 commit fa9e452
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/io/dataset_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1472,7 +1472,7 @@ void DatasetLoader::CheckCategoricalFeatureNumBin(
if (bin_mappers.size() < 1024) {
for (size_t i = 0; i < bin_mappers.size(); ++i) {
const int max_bin_for_this_feature = max_bin_by_feature.empty() ? max_bin : max_bin_by_feature[i];
if (bin_mappers[i]->bin_type() == BinType::CategoricalBin && bin_mappers[i]->num_bin() > max_bin_for_this_feature) {
if (bin_mappers[i] != nullptr && bin_mappers[i]->bin_type() == BinType::CategoricalBin && bin_mappers[i]->num_bin() > max_bin_for_this_feature) {
need_warning = true;
break;
}
Expand Down

0 comments on commit fa9e452

Please sign in to comment.