diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index aac9ba79f..18052e425 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -2619,7 +2619,7 @@ void GCode::process_layers( for (size_t layer_idx = range.begin(); layer_idx < range.end(); ++layer_idx) { print.throw_if_canceled(); if (layer_idx > 0) { - LayerToPrint &layer = layers_to_print[layer_idx++]; + LayerToPrint &layer = layers_to_print[layer_idx]; cooling_buffer.apply_smooth_speed(smooth_calculator, layers_extruder_adjustments[layer_idx], layer_idx); } } diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp index 65c9405a5..df4ce0666 100644 --- a/src/libslic3r/PrintObject.cpp +++ b/src/libslic3r/PrintObject.cpp @@ -170,6 +170,10 @@ void PrintObject::merge_layer_node(const size_t layer_id, int &max_merged_id, st continue; auto it = node_record.find(appear_id[appear_node_idx]); + //protect + if (it == node_record.end()) + continue; + std::vector> &appear_node_pos = it->second; for (size_t node_idx = 0; node_idx < appear_node_pos.size(); ++node_idx) {