diff --git a/src/libslic3r/Fill/FillEnsuring.cpp b/src/libslic3r/Fill/FillEnsuring.cpp index a64c0fd83..aa19bf09f 100644 --- a/src/libslic3r/Fill/FillEnsuring.cpp +++ b/src/libslic3r/Fill/FillEnsuring.cpp @@ -71,9 +71,11 @@ ThickPolylines make_fill_polylines( vertical_lines[i].a = Point{x, y_min}; vertical_lines[i].b = Point{x, y_max}; } - vertical_lines.push_back(vertical_lines.back()); - vertical_lines.back().a = Point{coord_t(bb.min.x() + n_vlines * double(scaled_spacing) + scaled_spacing * 0.5), y_min}; - vertical_lines.back().b = Point{vertical_lines.back().a.x(), y_max}; + if (vertical_lines.size() > 0) { + vertical_lines.push_back(vertical_lines.back()); + vertical_lines.back().a = Point{coord_t(bb.min.x() + n_vlines * double(scaled_spacing) + scaled_spacing * 0.5), y_min}; + vertical_lines.back().b = Point{vertical_lines.back().a.x(), y_max}; + } std::vector> polygon_sections(n_vlines);