From 4983af4610d5d97ac3ec1eb21e46d34d2e603359 Mon Sep 17 00:00:00 2001 From: Yu Shi Date: Wed, 1 Jun 2022 14:29:12 +0000 Subject: [PATCH] check nullable of bin mappers --- src/io/dataset_loader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/io/dataset_loader.cpp b/src/io/dataset_loader.cpp index 4a77bd1c1d46..a2fcb860d5b6 100644 --- a/src/io/dataset_loader.cpp +++ b/src/io/dataset_loader.cpp @@ -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; }