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

avoid segment fault in ResetConfig for GBDT in prediction (fix #3317) (#3373)

parent f7f4e602
......@@ -20,6 +20,7 @@ namespace LightGBM {
GBDT::GBDT()
: iter_(0),
train_data_(nullptr),
config_(nullptr),
objective_function_(nullptr),
early_stopping_round_(0),
es_first_metric_only_(false),
......@@ -718,7 +719,7 @@ void GBDT::ResetConfig(const Config* config) {
if (train_data_ != nullptr) {
ResetBaggingConfig(new_config.get(), false);
}
if (config_->forcedsplits_filename != new_config->forcedbins_filename) {
if (config_.get() != nullptr && config_->forcedsplits_filename != new_config->forcedbins_filename) {
// load forced_splits file
if (!new_config->forcedsplits_filename.empty()) {
std::ifstream forced_splits_file(
......
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