From bea18e91aa08ac3ef6fb6fb07f5db5ea88e5c05c Mon Sep 17 00:00:00 2001 From: Zach Pomerantz Date: Mon, 28 Dec 2015 15:09:49 -0800 Subject: [PATCH] Guard against empty polyline index out of range --- .../entities-renderer/src/RenderablePolyLineEntityItem.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libraries/entities-renderer/src/RenderablePolyLineEntityItem.cpp b/libraries/entities-renderer/src/RenderablePolyLineEntityItem.cpp index cfdcc87121..7b3bbc4c02 100644 --- a/libraries/entities-renderer/src/RenderablePolyLineEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderablePolyLineEntityItem.cpp @@ -141,6 +141,11 @@ void RenderablePolyLineEntityItem::updateVertices() { _vertices << v1 << v2; } + // Guard against an empty polyline + if (finalIndex < 0) { + return; + } + // For last point we can assume binormals are the same since it represents the last two vertices of quad point = _points.at(finalIndex); v1 = point + binormal;