diff --git a/Mirror/Runtime/NetworkBehaviour.cs b/Mirror/Runtime/NetworkBehaviour.cs index e58b7067c..47c1f2a92 100644 --- a/Mirror/Runtime/NetworkBehaviour.cs +++ b/Mirror/Runtime/NetworkBehaviour.cs @@ -35,14 +35,10 @@ NetworkIdentity myView { get { + m_MyView = m_MyView ?? GetComponent(); if (m_MyView == null) { - m_MyView = GetComponent(); - if (m_MyView == null) - { - if (LogFilter.logError) { Debug.LogError("There is no NetworkIdentity on this object. Please add one."); } - } - return m_MyView; + if (LogFilter.logError) { Debug.LogError("There is no NetworkIdentity on this object. Please add one."); } } return m_MyView; }