mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
using null propagation for RemoveOwnedObject (#2347)
This commit is contained in:
parent
09d38977d5
commit
ebc9f7a4b3
@ -117,7 +117,7 @@ public NetworkIdentity netIdentity
|
||||
// do this 2nd check inside first if so that we are not checking == twice on unity Object
|
||||
if (netIdentityCache is null)
|
||||
{
|
||||
logger.LogError("There is no NetworkIdentity on " + name + ". Please add one.");
|
||||
Debug.LogError("There is no NetworkIdentity on " + name + ". Please add one.");
|
||||
}
|
||||
}
|
||||
return netIdentityCache;
|
||||
|
@ -214,9 +214,7 @@ public NetworkConnectionToClient connectionToClient
|
||||
|
||||
internal set
|
||||
{
|
||||
if (_connectionToClient != null)
|
||||
_connectionToClient.RemoveOwnedObject(this);
|
||||
|
||||
_connectionToClient?.RemoveOwnedObject(this);
|
||||
_connectionToClient = value;
|
||||
_connectionToClient?.AddOwnedObject(this);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user