Skip to content
Snippets Groups Projects
Commit 84b58df6 authored by David Gilbert's avatar David Gilbert :bug:
Browse files

fix(replication, cave): Fixes nullptr access when logging

parent 16b89cf6
No related branches found
No related tags found
2 merge requests!107UE5.4-2024.1-rc1,!98Improved join/attachment logic for clusters to support multi-cluster connections at some point
Pipeline #442214 failed
...@@ -79,12 +79,17 @@ void AClusterRepresentationActor::AttachDCRAIfRequired(const ARWTHVRPlayerState* ...@@ -79,12 +79,17 @@ void AClusterRepresentationActor::AttachDCRAIfRequired(const ARWTHVRPlayerState*
return; return;
} }
const auto CCA = PlayerState->GetCorrespondingClusterActor();
if (CCA == nullptr) // this can happen often if property isn't replicated yet, this is okay.
return;
UE_LOGFMT(Toolkit, Display, UE_LOGFMT(Toolkit, Display,
"{Name} AttachDCRAIfRequired: Player State is {PlayerState}, PlayerState->CCA is {CCA}.", GetName(), "{Name} AttachDCRAIfRequired: Player State is {PlayerState}, PlayerState->CCA is {CCA}.", GetName(),
PlayerState->GetName(), PlayerState->GetCorrespondingClusterActor()->GetName()); PlayerState->GetName(), CCA->GetName());
// The local player this is executed on corresponds to this actor // The local player this is executed on corresponds to this actor
if (PlayerState->GetCorrespondingClusterActor() == this) if (CCA == this)
{ {
UE_LOGFMT(Toolkit, Display, "{Name} AttachDCRAIfRequired: Attaching DCRA to {Name}.", GetName()); UE_LOGFMT(Toolkit, Display, "{Name} AttachDCRAIfRequired: Attaching DCRA to {Name}.", GetName());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment