From b86effada01fc82be021195a26fd1135aae7cdf9 Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Thu, 13 Jan 2022 21:52:54 +0100 Subject: [PATCH] Fixed one possible crash and a warning --- src/libslic3r/GCode/SeamPlacer.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/libslic3r/GCode/SeamPlacer.cpp b/src/libslic3r/GCode/SeamPlacer.cpp index 218ced89cb..eee7162e11 100644 --- a/src/libslic3r/GCode/SeamPlacer.cpp +++ b/src/libslic3r/GCode/SeamPlacer.cpp @@ -366,8 +366,8 @@ void SeamPlacer::place_seam(ExtrusionLoop& loop, const Point& last_pos, bool ext if (!ext_seams.empty()) { // First find the line segment closest to an external seam: - int path_idx = 0; - int line_idx = 0; + //int path_idx = 0; + //int line_idx = 0; size_t ext_seam_idx = size_t(-1); double min_dist_sqr = std::numeric_limits::max(); std::vector lines_vect; @@ -378,8 +378,8 @@ void SeamPlacer::place_seam(ExtrusionLoop& loop, const Point& last_pos, bool ext for (size_t k : ext_seams) { double d_sqr = lines[j].distance_to_squared(m_plan[k].pt); if (d_sqr < min_dist_sqr) { - path_idx = i; - line_idx = j; + //path_idx = i; + //line_idx = j; ext_seam_idx = k; min_dist_sqr = d_sqr; } @@ -495,7 +495,7 @@ Point SeamPlacer::calculate_seam(const Layer& layer, const SeamPosition seam_pos if (po == m_last_po && layer.print_z == m_last_print_z) layer_po = m_last_layer_po; else { - layer_po = po->get_layer_at_printz(layer.print_z); + layer_po = po ? po->get_layer_at_printz(layer.print_z) : nullptr; m_last_po = po; m_last_print_z = layer.print_z; m_last_layer_po = layer_po;