Skip to content

Commit 39388fe

Browse files
authored
Merge pull request #3008 from StephenHodgson/vNEXT-ControllerFinderFix
added null checks for controllers in input source events
2 parents a0fc18f + 605f8c0 commit 39388fe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Assets/MixedRealityToolkit-SDK/Features/Utilities/Solvers/ControllerFinder.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,15 @@ protected virtual void OnEnable()
5555

5656
public void OnSourceDetected(SourceStateEventData eventData)
5757
{
58-
if (eventData.Controller.ControllerHandedness == handedness)
58+
if (eventData.Controller?.ControllerHandedness == handedness)
5959
{
6060
AddControllerTransform(eventData.Controller);
6161
}
6262
}
6363

6464
public void OnSourceLost(SourceStateEventData eventData)
6565
{
66-
if (eventData.Controller.ControllerHandedness == handedness)
66+
if (eventData.Controller?.ControllerHandedness == handedness)
6767
{
6868
RemoveControllerTransform();
6969
}

0 commit comments

Comments
 (0)