Skip to content

Commit 08f6f99

Browse files
authored
fix: prevent exception in Boss Room with NetworkAnimator (#2140)
fix: prevent exception in Boss Room with NetworkAnimator due to m_NetworkBehaviour being null
1 parent 63628c7 commit 08f6f99

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

com.unity.netcode.gameobjects/Runtime/NetworkVariable/NetworkVariableBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ protected NetworkVariableBase(
7979
public virtual void SetDirty(bool isDirty)
8080
{
8181
m_IsDirty = isDirty;
82-
if (m_IsDirty)
82+
if (m_IsDirty && m_NetworkBehaviour != null)
8383
{
8484
m_NetworkBehaviour.NetworkManager.MarkNetworkObjectDirty(m_NetworkBehaviour.NetworkObject);
8585
}

0 commit comments

Comments
 (0)