Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible System.NullReferenceException in LagCompensationManager #204

Open
Lunatix89 opened this issue Feb 10, 2023 · 0 comments
Open

Possible System.NullReferenceException in LagCompensationManager #204

Lunatix89 opened this issue Feb 10, 2023 · 0 comments

Comments

@Lunatix89
Copy link

I just stumbled across this while taking a look at the LagCompensationManager - there is a possible System.NullReferenceException in Update:47 which will be caused when networkManager is null.

The issue with this line is, that the && operator has precedence over || so if networkManager is null, it will check the second condition, networkManager.IsClient.

// wrong
networkManger != null && networkManger.IsServer || networkManger.IsClient

// correct
networkManger != null && (networkManger.IsServer || networkManger.IsClient)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant