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
Checking IsNetworkInitialized before _net has been set by the Start() function results in error. I am calling it from a listener on Rooms.JoinedRoom, but Dissonance doesn't seem to be fully initialized.
Expected Behavior
If _net is not set IsNetworkInitialized should return false.
Actual Behavior
NullReferenceException: Object reference not set to an instance of an object
Dissonance.DissonanceComms.get_IsNetworkInitialized () (at Assets/Plugins/Dissonance/DissonanceComms.cs:198)
Workaround
Check IsNetworkInitialized on the next frame to ensure existence of _net in Dissonance instance.
Fix
Current Code:
public bool IsNetworkInitialized
{
get { return _net.Status == ConnectionStatus.Connected; }
}
Fix:
public bool IsNetworkInitialized
{
get { return _net != null && _net.Status == ConnectionStatus.Connected; }
}
The text was updated successfully, but these errors were encountered:
Hi sayangel, thanks for the excellent bug report 👍
Your workaround is exactly right. I've also added checks to VoiceBroadcastTrigger and VoiceReceiptTrigger so that they will not do anything until DissonanceComms:Start has been called, to make things a bit neater in the most common path. That should be included in the next version of Dissonance.
Dissonance 6.1.0 just released onto the asset store with a fix for this. I'll close the issue but please don't hesitate to re-open it if it's still a problem :)
Context
Checking IsNetworkInitialized before _net has been set by the Start() function results in error. I am calling it from a listener on Rooms.JoinedRoom, but Dissonance doesn't seem to be fully initialized.
Expected Behavior
If _net is not set IsNetworkInitialized should return false.
Actual Behavior
Workaround
Check IsNetworkInitialized on the next frame to ensure existence of _net in Dissonance instance.
Fix
Current Code:
Fix:
The text was updated successfully, but these errors were encountered: