@@ -248,10 +248,10 @@ private void CreateDataProviders()
248248 MixedRealityInputSystemProfile profile = ConfigurationProfile as MixedRealityInputSystemProfile ;
249249
250250 // If the system gets disabled, the gaze provider is destroyed.
251- // Ensure that it gets recreated on when reenabled .
252- if ( GazeProvider == null )
251+ // Ensure that it gets recreated on when re-enabled .
252+ if ( GazeProvider == null && profile != null )
253253 {
254- InstantiateGazeProvider ( profile ? . PointerProfile ) ;
254+ InstantiateGazeProvider ( profile . PointerProfile ) ;
255255 }
256256
257257 if ( ( GetDataProviders ( ) . Count == 0 ) && ( profile != null ) )
@@ -272,7 +272,7 @@ private void CreateDataProviders()
272272
273273 private void InstantiateGazeProvider ( MixedRealityPointerProfile pointerProfile )
274274 {
275- if ( pointerProfile ? . GazeProviderType ? . Type != null )
275+ if ( pointerProfile != null && pointerProfile . GazeProviderType ? . Type != null )
276276 {
277277 GazeProvider = CameraCache . Main . gameObject . EnsureComponent ( pointerProfile . GazeProviderType . Type ) as IMixedRealityGazeProvider ;
278278 GazeProvider . GazeCursorPrefab = pointerProfile . GazeCursorPrefab ;
@@ -991,7 +991,12 @@ public void RaiseFocusExit(IMixedRealityPointer pointer, GameObject unfocusedObj
991991 public void RaisePointerDown ( IMixedRealityPointer pointer , MixedRealityInputAction inputAction , Handedness handedness = Handedness . None , IMixedRealityInputSource inputSource = null )
992992 {
993993 // Only lock the object if there is a grabbable above in the hierarchy
994- Transform currentObject = pointer . Result ? . Details . Object ? . transform ;
994+ Transform currentObject = null ;
995+ GameObject currentGameObject = pointer . Result ? . Details . Object ;
996+ if ( currentGameObject != null )
997+ {
998+ currentObject = currentGameObject . transform ;
999+ }
9951000 IMixedRealityPointerHandler ancestorPointerHandler = null ;
9961001 while ( currentObject != null && ancestorPointerHandler == null )
9971002 {
0 commit comments