Open aybe opened 2 months ago
First fix is valid. Casting UnityEngine.Object to bool is essentially a null-check, but shorter. Reference
So, in this case, Visual Studio's warning about null-dereferencing is invalid.
The second fix modifies code behavior by only checking the reference for null, ignoring the UnityEngine.Object lifetime.
Both context actions are applicable.
Just noticed that new suggestion after upgrading today.
See by yourself, code was fine but applying either fix makes it worse actually:
New icon:
Fixes:
After fix 1:
After fix 2: