Make sure we don't try to use the elements out of the speeds list when there aren't any.
This commit is contained in:
parent
fed87448a5
commit
6be44559fe
1 changed files with 6 additions and 0 deletions
|
|
@ -31,6 +31,12 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
|
||||
speeds.Select(speed => extrusionColors.GetColorForSpeed(speed)).ToArray();
|
||||
|
||||
if(speeds.Count <= 0)
|
||||
{
|
||||
// There are no paths so don't generate the rest of the widget.
|
||||
return;
|
||||
}
|
||||
|
||||
float min = speeds.Min();
|
||||
float max = speeds.Max();
|
||||
int maxItems = Math.Min(7, speeds.Count());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue