Can't do operations on `NetworkList` with no `NetworkManager` (offline)
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: https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/commit/dfd08d84e535146e8c709b91f9eea62dd05bff1a
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?