Skip to content
Snippets Groups Projects
Commit ad529cf3 authored by Konstantin Kühlem's avatar Konstantin Kühlem
Browse files

fix: GetFactorLevel() causes a crash, if the there is no valid condition (yet)

Altough the method was designed for returning an invalid/absent factore level
parent 7df6cacd
No related branches found
No related tags found
No related merge requests found
...@@ -762,7 +762,9 @@ FString USFGameInstance::GetFactorLevel(FString FactorName) const ...@@ -762,7 +762,9 @@ FString USFGameInstance::GetFactorLevel(FString FactorName) const
{ {
return "ParticipantNotSet"; return "ParticipantNotSet";
} }
if (Participant->GetCurrentCondition()->FactorLevels.Contains(FactorName))
const auto* Condition = Participant->GetCurrentCondition();
if (Condition != nullptr && Condition->FactorLevels.Contains(FactorName))
{ {
return Participant->GetCurrentCondition()->FactorLevels[FactorName]; return Participant->GetCurrentCondition()->FactorLevels[FactorName];
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment