Closed studentutu closed 2 years ago
as well as this issue :
NullReferenceException: Object reference not set to an instance of an object
File "<03c4cef74c314705b9055b51c799ab32>", line 0, in Zinnia.Cast.PointsCast.OnAfterTargetHitChange
File "<03c4cef74c314705b9055b51c799ab32>", line 0, in Zinnia.Cast.PointsCast.OnEnable
File "<03c4cef74c314705b9055b51c799ab32>", line 0, in Zinnia.Cast.StraightLineCast.OnEnable
@thestonefox found out the cause - public RaycastHit? TargetHit - is not being cleared on disable.
So we should probably guard against the null's anyway, but also clear the TargetHit on disable too
maybe there are other places that should clear the state/object in onDisable?
If you find anywhere else then list it here.
I can try create a test to replicate the issue so it can be run in the test suite to prove any fixes applied cause the test to pass
Also, I can now check it reliable:
Put Enabling of the Whole Straight Pointer GameObject onto TrackedAlias.[Right|Left]ControllerTrackingBegun events
@thestonefox So far - only this is the biggest cause of issues. When running app in kiosk mode (launcher mode) -> it is only 1 place that we have encountered such errors
This one is the main cause for the errors - so if StraightLineCast will clear TargetHit -> we should not have other issues
NullReferenceException: Object reference not set to an instance of an object
File "<3a45b3222c88403089655c9337569bae>", line 0, in Zinnia.Cast.PointsCast.OnAfterTargetHitChange
File "<3a45b3222c88403089655c9337569bae>", line 0, in Zinnia.Cast.PointsCast.OnEnable
File "<3a45b3222c88403089655c9337569bae>", line 0, in Zinnia.Cast.StraightLineCast.OnEnable
:tada: This issue has been resolved in version 1.45.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
Environment
Unity 2020.3.16f1
Steps to reproduce
1) Create simple rig with CameraRigs.TrackedAlias and 2 interactable pointers 2) Add Straight Pointers for left/right hand. Make it always visible. Set activations so that the activation event is always processed (pointer is always active) 4) Build Android Project and run on Pico 5) Launch App 6) Press Home button to navigate to Pico Quick System Menu. Wait for few seconds. 6) Go back to your app ( continue your app) 7) Sometimes it will throw out of boundary exceptions. ( 5/5) tries
This is also reproducible on Quest 1.
Expected behavior
It should have a check for length before using indecies.
Current behavior
ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index ?, line 0, in System.ThrowHelper.ThrowArgumentOutOfRangeException ?, line 0, in System.ThrowHelper.ThrowArgumentOutOfRangeException ?, line 0, in System.Collections.Generic.List`1[T].set_Item ?, line 0, in Zinnia.Cast.StraightLineCast.GeneratePoints ?, line 0, in Zinnia.Cast.StraightLineCast.DoCastPoints ?, line 0, in Zinnia.Process.Moment.MomentProcess.ProcessNow ?, line 0, in Zinnia.Process.Moment.MomentProcessor.Process ?, line 0, in UnityEngine.Camera+CameraCallback.Invoke
Briefly describe what is actually happening.