Guard against observed exception

This commit is contained in:
John Lewin 2018-04-06 16:02:51 -07:00
parent 60ec4daaab
commit 27dd2ecedb

View file

@ -47,9 +47,16 @@ namespace MatterHackers.GCodeVisualizer
public ExtrusionColors(HashSet<float> speeds)
{
min = speeds.Min();
max = speeds.Max();
if (speeds.Any())
{
min = speeds.Min();
max = speeds.Max();
}
else
{
min = 0;
max = 1;
}
range = max - min;
delta = startColor - endColor;