Skip to content

Commit

Permalink
Fix: OnRep_Pawn nullptr check
Browse files Browse the repository at this point in the history
  • Loading branch information
ameaninglessname committed Oct 4, 2022
1 parent 091d32e commit a204ebb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Source/ALSV4_CPP/Private/Character/ALSPlayerController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,12 @@ void AALSPlayerController::OnRep_Pawn()
SetupCamera();

#if ENABLE_ALS_DEBUG_COMPONENT
if (UALSDebugComponent* DebugComp = Cast<UALSDebugComponent>(PossessedCharacter->GetComponentByClass(UALSDebugComponent::StaticClass())))
if (PossessedCharacter)
{
DebugComp->OnPlayerControllerInitialized(this);
if (UALSDebugComponent* DebugComp = PossessedCharacter->FindComponentByClass<UALSDebugComponent>())
{
DebugComp->OnPlayerControllerInitialized(this);
}
}
#endif
}
Expand Down

0 comments on commit a204ebb

Please sign in to comment.