Unverified Commit 0a4851f5 authored by shiyu1994's avatar shiyu1994 Committed by GitHub
Browse files

check nullable of bin_mappers in DatasetLoader::CheckCategoricalFeatureNumBin (fix #5145) (#5146)

parent 9a964fef
...@@ -1485,7 +1485,7 @@ void DatasetLoader::CheckCategoricalFeatureNumBin( ...@@ -1485,7 +1485,7 @@ void DatasetLoader::CheckCategoricalFeatureNumBin(
for (size_t i = start; i < end; ++i) { for (size_t i = start; i < end; ++i) {
thread_need_warning[thread_index] = false; thread_need_warning[thread_index] = false;
const int max_bin_for_this_feature = max_bin_by_feature.empty() ? max_bin : max_bin_by_feature[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) {
thread_need_warning[thread_index] = true; thread_need_warning[thread_index] = true;
break; break;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment