Fix of a crash when slicing an object producing no layers and

elphant foot compensation is enabled.
This commit is contained in:
Vojtech Bubnik 2021-01-11 12:20:50 +01:00
parent d46a756b98
commit 5a1a41096b

View File

@ -2004,10 +2004,9 @@ end:
layer->make_slices(); layer->make_slices();
} }
}); });
if (elephant_foot_compensation_scaled > 0.f) { if (elephant_foot_compensation_scaled > 0.f && ! m_layers.empty()) {
// The Elephant foot has been compensated, therefore the 1st layer's lslices are shrank with the Elephant foot compensation value. // The Elephant foot has been compensated, therefore the 1st layer's lslices are shrank with the Elephant foot compensation value.
// Store the uncompensated value there. // Store the uncompensated value there.
assert(! m_layers.empty());
assert(m_layers.front()->id() == 0); assert(m_layers.front()->id() == 0);
m_layers.front()->lslices = std::move(lslices_1st_layer); m_layers.front()->lslices = std::move(lslices_1st_layer);
} }