From 38d8854a48991c5720e7cc31b5ea2b46f21b00e9 Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Tue, 1 Oct 2019 12:48:58 +0200 Subject: [PATCH] Print::validate() - check for empty print has been moved at the beginning of the function This prevents a crash when the print is empty and the wipe tower enabled - validation of the wipe tower attempted to access extruders().front(), which was empty. No other checks need to be done with the empty print anyway. --- src/libslic3r/Print.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index f5601276f..a5800b007 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -1114,6 +1114,9 @@ std::string Print::validate() const if (m_objects.empty()) return L("All objects are outside of the print volume."); + if (extruders().empty()) + return L("The supplied settings will cause an empty print."); + if (m_config.complete_objects) { // Check horizontal clearance. { @@ -1271,10 +1274,7 @@ std::string Print::validate() const } { - // find the smallest nozzle diameter std::vector extruders = this->extruders(); - if (extruders.empty()) - return L("The supplied settings will cause an empty print."); // Find the smallest used nozzle diameter and the number of unique nozzle diameters. double min_nozzle_diameter = std::numeric_limits::max();