Skip to content
This repository has been archived by the owner on Aug 11, 2024. It is now read-only.

Commit

Permalink
fix NRE if tracked poses is null in BaseHandControllerDataProvider.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenHodgson committed May 17, 2021
1 parent b210c2e commit fdc4973
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public abstract class BaseHandControllerDataProviderProfile : BaseMixedRealityCo

[SerializeField]
[Tooltip("Tracked hand poses for pose detection.")]
private HandControllerPoseProfile[] trackedPoses = null;
private HandControllerPoseProfile[] trackedPoses = new HandControllerPoseProfile[0];

/// <summary>
/// Tracked hand poses for pose detection.
Expand All @@ -77,4 +77,4 @@ public override ControllerDefinition[] GetDefaultControllerOptions()
};
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ protected BaseHandControllerDataProvider(string name, uint priority, BaseHandCon
? profile.BoundsMode
: inputSystemProfile.BoundsMode;

if (profile.TrackedPoses.Count > 0)
if (profile.TrackedPoses != null &&
profile.TrackedPoses.Count > 0)
{
TrackedPoses = profile.TrackedPoses.Count != inputSystemProfile.TrackedPoses.Count
? profile.TrackedPoses
Expand Down Expand Up @@ -70,4 +71,4 @@ protected BaseHandControllerDataProvider(string name, uint priority, BaseHandCon
/// </summary>
protected IReadOnlyList<HandControllerPoseProfile> TrackedPoses { get; }
}
}
}

0 comments on commit fdc4973

Please sign in to comment.