Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
Possible crash when finializing a layer plan and prime tower not
initialized. Although not possible in normal execution (prime tower is
always initialized first), it is still a healthy fix.

CURA-11717
  • Loading branch information
wawanbreton committed Apr 2, 2024
1 parent fa6025f commit 1ee8726
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/sliceDataStorage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -362,13 +362,9 @@ Polygons SliceDataStorage::getLayerOutlines(
total.add(support_layer.support_roof);
}
}
int prime_tower_outer_extruder_nr = primeTower.extruder_order_[0];
if (include_prime_tower && (extruder_nr == -1 || extruder_nr == prime_tower_outer_extruder_nr))
if (include_prime_tower && primeTower.enabled_ && (extruder_nr == -1 || (! primeTower.extruder_order_.empty() && extruder_nr == primeTower.extruder_order_[0])))
{
if (primeTower.enabled_)
{
total.add(primeTower.getOuterPoly(layer_nr));
}
total.add(primeTower.getOuterPoly(layer_nr));
}
return total;
}
Expand Down

0 comments on commit 1ee8726

Please sign in to comment.