You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if you check a UnityEngine.Object to be null or not, you simply can do the following:
privatevoidUpdate(){if(!someGameObject){// is nullreturn;}// is not null here
someGameObject.DoSomething();// Possible System.NullReferenceException}
In the last line Rider still suggests that someGameObject could be null, which I think is not correct.
That line of code should not be reachable due to the return statement in the if-branch, when someGameObject is null.
The text was updated successfully, but these errors were encountered:
I think this is fixed with #1906 (it will be in EAP6 of Rider 2020.3), but I can't get the original issue to show a warning without adding [CanBeNull]. Can you please confirm the repro sample - how is someGameObject declared, etc.? I'm closing for now, but happy to reopen if it's not fixed.
Hi,
if you check a
UnityEngine.Object
to be null or not, you simply can do the following:In the last line Rider still suggests that
someGameObject
could be null, which I think is not correct.That line of code should not be reachable due to the return statement in the if-branch, when
someGameObject
is null.The text was updated successfully, but these errors were encountered: