diff --git a/Fika.Core/Coop/Players/CoopBot.cs b/Fika.Core/Coop/Players/CoopBot.cs index 1821ed80..e5ad3f05 100644 --- a/Fika.Core/Coop/Players/CoopBot.cs +++ b/Fika.Core/Coop/Players/CoopBot.cs @@ -253,7 +253,10 @@ private IEnumerator DestroyNetworkedComponents() { yield return new WaitForSeconds(2); - PacketSender.DestroyThis(); + if (PacketSender != null) + { + PacketSender.DestroyThis(); + } } public override void UpdateTick() diff --git a/Fika.Core/Coop/Players/CoopPlayer.cs b/Fika.Core/Coop/Players/CoopPlayer.cs index afa32b7a..4bef608b 100644 --- a/Fika.Core/Coop/Players/CoopPlayer.cs +++ b/Fika.Core/Coop/Players/CoopPlayer.cs @@ -533,7 +533,10 @@ private IEnumerator DestroyNetworkedComponents() { yield return new WaitForSeconds(2); - PacketSender.DestroyThis(); + if (PacketSender != null) + { + PacketSender.DestroyThis(); + } } public override void Move(Vector2 direction) @@ -1342,7 +1345,10 @@ public override void OnDestroy() public override void Dispose() { base.Dispose(); - PacketSender.DestroyThis(); + if (PacketSender != null) + { + PacketSender.DestroyThis(); + } } public override void SendHandsInteractionStateChanged(bool value, int animationId)