Skip to content

Commit 31ce0f2

Browse files
Merge pull request #197 from immutable/dx-3654
Fix warning coming from trying to load passport settings save game when the save game doesn't exist
2 parents efa1bc1 + d032141 commit 31ce0f2

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Source/Immutable/Private/Immutable/ImmutablePassport.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -657,11 +657,12 @@ void UImmutablePassport::SavePassportSettings()
657657

658658
void UImmutablePassport::LoadPassportSettings()
659659
{
660-
UImmutableSaveGame* SaveGameInstance = Cast<UImmutableSaveGame>(UGameplayStatics::LoadGameFromSlot(PASSPORT_SAVE_GAME_SLOT_NAME, 0));
661-
662-
if (SaveGameInstance)
660+
if (UGameplayStatics::DoesSaveGameExist(PASSPORT_SAVE_GAME_SLOT_NAME, 0))
663661
{
664-
SaveGameInstance->bWasConnectedViaPKCEFlow ? SetStateFlags(IPS_PKCE) : ResetStateFlags(IPS_PKCE);
662+
if (const UImmutableSaveGame* SaveGameInstance = Cast<UImmutableSaveGame>(UGameplayStatics::LoadGameFromSlot(PASSPORT_SAVE_GAME_SLOT_NAME, 0)))
663+
{
664+
SaveGameInstance->bWasConnectedViaPKCEFlow ? SetStateFlags(IPS_PKCE) : ResetStateFlags(IPS_PKCE);
665+
}
665666
}
666667
}
667668

0 commit comments

Comments
 (0)