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:
Lars Brubaker 2015-05-28 11:39:24 -07:00
parent fed87448a5
commit 6be44559fe

View file

@ -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());