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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit cebbbccd825b282a1a322271246a4603810c4e31
|
||||
Subproject commit 6e36de975620da1f06daefbd082cccecb8a927d6
|
||||
Loading…
Add table
Add a link
Reference in a new issue