Skip to content

Commit

Permalink
Merge pull request #1805 from JWNJWN/bug/highlighter-IOR
Browse files Browse the repository at this point in the history
fix(highlighter): index out of range
  • Loading branch information
thestonefox authored May 18, 2018
2 parents 94ad07e + ccc7ac1 commit 664540f
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ protected virtual void ResetHighlighterWithCustomModelPaths()
{
if (customOutlineModelPaths != null && customOutlineModelPaths.Length > 0)
{
highlightModels = new Renderer[customOutlineModels.Length];
highlightModels = new Renderer[customOutlineModelPaths.Length];
for (int i = 0; i < customOutlineModelPaths.Length; i++)
{
highlightModels[i] = CreateHighlightModel(null, customOutlineModelPaths[i]);
Expand Down Expand Up @@ -231,7 +231,10 @@ protected virtual Renderer CreateHighlightModel(GameObject givenOutlineModel, st
{
Renderer copyModelRenderer = objectToAffect.GetComponentInChildren<Renderer>();
copyModel = (copyModelRenderer != null ? copyModelRenderer.gameObject : null);
}

if (copyModel == null)
{
VRTK_Logger.Error(VRTK_Logger.GetCommonMessage(VRTK_Logger.CommonMessageKeys.REQUIRED_COMPONENT_MISSING_FROM_GAMEOBJECT, "VRTK_OutlineObjectCopyHighlighter", "Renderer", "the same or child", " to add the highlighter to"));
return null;
}
Expand Down

0 comments on commit 664540f

Please sign in to comment.