Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid null pointer dereference for partial configuration settings #13885

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/libslic3r/PrintConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5130,7 +5130,14 @@ void DynamicPrintConfig::normalize_fdm()
}
}

if (this->has("wipe_tower_extruder")) {
// This method is called repeatedly while building configuration. We may
// not have enough info yet to determine whether the extruder is valid;
// wait until we do before checking.
//
// NOTE: other extruder validation (e.g. perimeter_extruder, infill_extruder)
// happens elsewhere, as those settings can be modified for specific print
// objects or sometimes even regions of objects.
if (this->has("wipe_tower_extruder") && this->has("nozzle_diameter")) {
// If invalid, replace with 0.
int extruder = this->opt<ConfigOptionInt>("wipe_tower_extruder")->value;
int num_extruders = this->opt<ConfigOptionFloats>("nozzle_diameter")->size();
Expand Down