NULL LoadedLevel in ULevelStreaming::UpdateStreamingState()

Occurs when when switching maps.

Steps to Reproduce

We’ve encountered a crash between these two lines in the ELevelStreamingState::MakingInvisible portion of ULevelStreaming::UpdateStreamingState(). This occurs when switching loaded maps.

LevelLoaded becomes NULL’ed after the RemoveFromWorld() call occurs.

// Hide loaded level, incrementally if necessary
World->RemoveFromWorld(LoadedLevel, !ShouldBlockOnUnload() && World->IsGameWorld(), TransactionId, this);
 
// Hide loaded level immediately if bRequireFullVisibilityToRender is set
const bool LevelBecameInvisible = bWasVisible && !LoadedLevel->bIsVisible;

Can you share the crash dump and the PDB so we can review what is happening? The dump should be under Saved\Crashes\<GUID>\… There will likely be multiple crash report. You can look at the content of CrashContext.runtime-xml to find which one contains the right stack.

Martin

We added the following between those to lines to work around the crash. If there is a better fix, please let us know. Thanks.

if (!LevelLoaded)
{
    break;
}

I swear I included a callstack when submitting. Not sure where that went. Posting again before I lose it:

>	UnrealEditor-Engine.dll!ULevelStreaming::UpdateStreamingState(bool & bOutUpdateAgain, bool & bOutRedetermineTarget) Line 1097	C++
 	[Inline Frame] UnrealEditor-Engine.dll!FStreamingLevelPrivateAccessor::UpdateStreamingState(ULevelStreaming *) Line 816	C++
 	UnrealEditor-Engine.dll!UWorld::UpdateLevelStreaming() Line 4445	C++
 	[Inline Frame] UnrealEditor-Engine.dll!UWorld::FlushLevelStreaming::__l2::<lambda_1>::operator()() Line 4745	C++
 	UnrealEditor-Engine.dll!UWorld::FlushLevelStreaming(EFlushLevelStreamingType FlushType) Line 4761	C++
 	UnrealEditor-Engine.dll!UEngine::LoadMap(FWorldContext & WorldContext, FURL URL, UPendingNetGame * Pending, FString & Error) Line 15658	C++
 	UnrealEditor-Engine.dll!UEngine::Browse(FWorldContext & WorldContext, FURL URL, FString & Error) Line 15216	C++
 	UnrealEditor-Engine.dll!UEngine::TickWorldTravel(FWorldContext & Context, float DeltaSeconds) Line 15379	C++
 	UnrealEditor-UnrealEd.dll!UEditorEngine::Tick(float DeltaSeconds, bool bIdleMode) Line 2114	C++
 	UnrealEditor-UnrealEd.dll!UUnrealEdEngine::Tick(float DeltaSeconds, bool bIdleMode) Line 550	C++

Unfortunately we did not save the PDB.