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

Can't do operations on NetworkList with no NetworkManager (offline) #2539

Open
PitouGames opened this issue Apr 30, 2023 · 1 comment · May be fixed by #2540
Open

Can't do operations on NetworkList with no NetworkManager (offline) #2539

PitouGames opened this issue Apr 30, 2023 · 1 comment · May be fixed by #2540
Labels
priority:medium stat:imported Issue is tracked internally at Unity type:bug Bug Report

Comments

@PitouGames
Copy link
Contributor

Description

When using a NetworkList with no NetworkManager in scene (in my solo mode), operations on the list (add, insert, remove, clear...) throws an NullReferenceException.
This is because of the use of m_NetworkBehaviour that hasn't been initialized.

NetworkVariable<T> doesn't suffer from this behaviour because a check on m_NetworkBehaviour is made.

Actual Outcome

A null reference exception is thrown an the operation is not done.

Expected Outcome

The operation is done.

Environment

  • OS: Windows 11
  • Unity Version: 2021.3.22f1
  • Netcode Version: develop (and all previous versions)
  • Netcode Commit: dfd08d8
@PitouGames PitouGames added stat:awaiting triage Status - Awaiting triage from the Netcode team. type:bug Bug Report labels Apr 30, 2023
PitouGames added a commit to PitouGames/com.unity.netcode.gameobjects that referenced this issue Apr 30, 2023
PitouGames added a commit to PitouGames/com.unity.netcode.gameobjects that referenced this issue May 2, 2023
@NoelStephensUnity NoelStephensUnity added stat:import priority:medium stat:imported Issue is tracked internally at Unity and removed stat:awaiting triage Status - Awaiting triage from the Netcode team. stat:import labels May 10, 2023
PitouGames added a commit to PitouGames/com.unity.netcode.gameobjects that referenced this issue Aug 19, 2023
@PitouGames
Copy link
Contributor Author

Bump!
I don't understand why it takes so long for this simple bug I reported and provided a solution. My PR is now waiting for 4 months...

Do you really prefere throwing a NullRefException (breaking code flow, so potentially other things) instead of doing the operation and showing the warning you wrote specially for this case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority:medium stat:imported Issue is tracked internally at Unity type:bug Bug Report
Projects
None yet
2 participants