From c767d5458be60133b8136090d1f94fb5f37f1953 Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Fri, 16 Feb 2024 11:48:07 +0100 Subject: [PATCH] Fix crash when using raft with airgap pseudo-layers --- src/FffGcodeWriter.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/FffGcodeWriter.cpp b/src/FffGcodeWriter.cpp index 8d39751c5f..ae15349935 100644 --- a/src/FffGcodeWriter.cpp +++ b/src/FffGcodeWriter.cpp @@ -1538,7 +1538,10 @@ void FffGcodeWriter::calculateExtruderOrderPerLayer(const SliceDataStorage& stor std::vector extruder_order = getUsedExtrudersOnLayerExcludingStartingExtruder(storage, last_extruder, layer_nr); extruder_order_per_layer_here.push_back(extruder_order); - last_extruder = extruder_order.back().extruder_nr; + if (! extruder_order.empty()) + { + last_extruder = extruder_order.back().extruder_nr; + } } }