Make sure we don't index past the end of the array
This commit is contained in:
parent
8c98cfb8ab
commit
409c9c8a88
2 changed files with 3 additions and 2 deletions
|
|
@ -342,7 +342,8 @@ namespace MatterHackers.GCodeVisualizer
|
|||
for (int i = renderInfo.EndLayerIndex - 1; i >= renderInfo.StartLayerIndex; i--)
|
||||
{
|
||||
// If its the first render or we change what we are trying to render then create vertex data.
|
||||
if (layerVertexBuffer[i] == null)
|
||||
if (layerVertexBuffer.Count > i
|
||||
&& layerVertexBuffer[i] == null)
|
||||
{
|
||||
layerVertexBuffer[i] = Create3DDataForLayer(i, renderInfo);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue