Description

When unloading a tile of a World Composition map in UE5, a crash occurs when trying to deference a null pointer (World->PersistentLevel->bIsVisible) in FWorldTileModel::FWorldTileModel():

		// Assign level object in case this level already loaded
		UPackage* LevelPackage = Cast<UPackage>(StaticFindObjectFast( UPackage::StaticClass(), NULL, Tile.PackageName) );
		if (LevelPackage)
		{
			// Find the world object
			UWorld* World = UWorld::FindWorldInPackage(LevelPackage);
			if (World && World->PersistentLevel)
			{
				LoadedLevel = World->PersistentLevel;

				// Enable tile properties
				TileDetails->bTileEditable = true;
				if (World->PersistentLevel->bIsVisible)
				{
					LoadedLevel.Get()->LevelBoundsActorUpdated().AddRaw(this, &FWorldTileModel::OnLevelBoundsActorUpdated);
				}
			}
		}

 

Steps to Reproduce
  • Open a World Composition map containing tiled Landscape in UE5.
  • Load all tiles (either through the levels browser or World Composition window).
  • Unload a tile.
  • A crash from dereferencing a nullptr should happen.
Callstack
>	UnrealEditor-WorldBrowser-Win64-Debug.dll!FWorldTileModel::FWorldTileModel(FWorldTileCollectionModel & InWorldModel, int InTileIdx) Line 78	C++	Symbols loaded.
 	UnrealEditor-WorldBrowser-Win64-Debug.dll!FWorldTileCollectionModel::OnLevelsCollectionChanged() Line 823	C++	Symbols loaded.
 	UnrealEditor-WorldBrowser-Win64-Debug.dll!FLevelCollectionModel::PopulateLevelsList() Line 253	C++	Symbols loaded.
 	UnrealEditor-WorldBrowser-Win64-Debug.dll!TBaseRawMethodDelegateInstance<0,FLevelCollectionModel,void __cdecl(void),FDefaultDelegateUserPolicy>::ExecuteIfSafe() Line 469	C++	Symbols loaded.
 	UnrealEditor-UnrealEd-Win64-Debug.dll!TMulticastDelegate<void __cdecl(void),FDefaultDelegateUserPolicy>::Broadcast() Line 967	C++	Symbols loaded.
 	UnrealEditor-UnrealEd-Win64-Debug.dll!UEditorLevelUtils::RemoveLevelsFromWorld(TArray<ULevel *,TSizedDefaultAllocator<32>> InLevels, bool bClearSelection, bool bResetTransBuffer) Line 860	C++	Symbols loaded.
 	UnrealEditor-UnrealEd-Win64-Debug.dll!UEditorLevelUtils::RemoveLevelFromWorld(ULevel * InLevel, bool bClearSelection, bool bResetTransBuffer) Line 903	C++	Symbols loaded.
 	UnrealEditor-WorldBrowser-Win64-Debug.dll!FLevelCollectionModel::UnloadLevels(const TArray<TSharedPtr<FLevelModel,1>,TSizedDefaultAllocator<32>> & InLevelList) Line 742	C++	Symbols loaded.
 	UnrealEditor-WorldBrowser-Win64-Debug.dll!FWorldTileCollectionModel::UnloadLevels(const TArray<TSharedPtr<FLevelModel,1>,TSizedDefaultAllocator<32>> & InLevelList) Line 170	C++	Symbols loaded.
 	UnrealEditor-WorldBrowser-Win64-Debug.dll!FLevelCollectionModel::UnloadSelectedLevels_Executed() Line 1526	C++	Symbols loaded.
 	UnrealEditor-WorldBrowser-Win64-Debug.dll!TBaseSPMethodDelegateInstance<0,FLevelCollectionModel,1,void __cdecl(void),FDefaultDelegateUserPolicy>::ExecuteIfSafe() Line 309	C++	Symbols loaded.
 	UnrealEditor-Slate-Win64-Debug.dll!TDelegate<void __cdecl(void),FDefaultDelegateUserPolicy>::ExecuteIfBound<void,0>() Line 607	C++	Symbols loaded.
 	UnrealEditor-Slate-Win64-Debug.dll!FUICommandList::ExecuteAction(const TSharedRef<FUICommandInfo const ,1> InUICommandInfo) Line 100	C++	Symbols loaded.
 	UnrealEditor-Slate-Win64-Debug.dll!SMenuEntryBlock::OnClicked(bool bCheckBoxClicked) Line 1148	C++	Symbols loaded.
 	UnrealEditor-Slate-Win64-Debug.dll!SMenuEntryBlock::OnMenuItemButtonClicked() Line 1108	C++	Symbols loaded.
 	UnrealEditor-Slate-Win64-Debug.dll!UE::Core::Private::Tuple::TTupleBase<TIntegerSequence<unsigned int>>::ApplyAfter<FReply (__cdecl SMenuEntryBlock::*const &)(void),SMenuEntryBlock * &>(FReply(SMenuEntryBlock::*)() & Func, SMenuEntryBlock * & <Args_0>) Line 324	C++	Symbols loaded.
 	UnrealEditor-Slate-Win64-Debug.dll!TBaseSPMethodDelegateInstance<0,SMenuEntryBlock,1,FReply __cdecl(void),FDefaultDelegateUserPolicy>::Execute() Line 290	C++	Symbols loaded.
 	UnrealEditor-Slate-Win64-Debug.dll!SButton::ExecuteOnClick() Line 464	C++	Symbols loaded.
 	UnrealEditor-Slate-Win64-Debug.dll!SButton::OnMouseButtonUp(const FGeometry & MyGeometry, const FPointerEvent & MouseEvent) Line 389	C++	Symbols loaded.
 	UnrealEditor-Slate-Win64-Debug.dll!SMenuEntryButton::OnMouseButtonUp(const FGeometry & MyGeometry, const FPointerEvent & MouseEvent) Line 431	C++	Symbols loaded.
 	UnrealEditor-Slate-Win64-Debug.dll!FSlateApplication::RoutePointerUpEvent::__l8::<lambda>(const FArrangedWidget & TargetWidget, const FPointerEvent & Event) Line 4961	C++	Symbols loaded.
 	UnrealEditor-Slate-Win64-Debug.dll!FEventRouter::Route<FReply,FEventRouter::FToLeafmostPolicy,FPointerEvent,FReply <lambda>(const FArrangedWidget &, const FPointerEvent &)>(FSlateApplication * ThisApplication, FEventRouter::FToLeafmostPolicy RoutingPolicy, FPointerEvent EventCopy, const FSlateApplication::RoutePointerUpEvent::__l8::FReply <lambda>(const FArrangedWidget &, const FPointerEvent &) & Lambda, ESlateDebuggingInputEvent DebuggingInputEvent) Line 405	C++	Symbols loaded.
 	UnrealEditor-Slate-Win64-Debug.dll!FSlateApplication::RoutePointerUpEvent(const FWidgetPath & WidgetsUnderPointer, const FPointerEvent & PointerEvent) Line 4947	C++	Symbols loaded.
 	UnrealEditor-Slate-Win64-Debug.dll!FSlateApplication::ProcessMouseButtonUpEvent(const FPointerEvent & MouseEvent) Line 5495	C++	Symbols loaded.
 	UnrealEditor-Slate-Win64-Debug.dll!FSlateApplication::OnMouseUp(const EMouseButtons::Type Button, const UE::Math::TVector2<double> CursorPos) Line 5460	C++	Symbols loaded.
 	UnrealEditor-ApplicationCore-Win64-Debug.dll!FWindowsApplication::ProcessDeferredMessage(const FDeferredWindowsMessage & DeferredMessage) Line 2210	C++	Symbols loaded.
 	UnrealEditor-ApplicationCore-Win64-Debug.dll!FWindowsApplication::DeferMessage(TSharedPtr<FWindowsWindow,1> & NativeWindow, HWND__ * InHWnd, unsigned int InMessage, unsigned __int64 InWParam, __int64 InLParam, int MouseX, int MouseY, unsigned int RawInputFlags) Line 2699	C++	Symbols loaded.
 	UnrealEditor-ApplicationCore-Win64-Debug.dll!FWindowsApplication::ProcessMessage(HWND__ * hwnd, unsigned int msg, unsigned __int64 wParam, __int64 lParam) Line 1080	C++	Symbols loaded.
 	UnrealEditor-ApplicationCore-Win64-Debug.dll!WindowsApplication_WndProc(HWND__ * hwnd, unsigned int msg, unsigned __int64 wParam, __int64 lParam) Line 910	C++	Symbols loaded.
 	UnrealEditor-ApplicationCore-Win64-Debug.dll!FWindowsApplication::AppWndProc(HWND__ * hwnd, unsigned int msg, unsigned __int64 wParam, __int64 lParam) Line 916	C++	Symbols loaded.
 	user32.dll!UserCallWinProcCheckWow()	Unknown	Symbols loaded.
 	user32.dll!DispatchMessageWorker()	Unknown	Symbols loaded.
 	UnrealEditor-ApplicationCore-Win64-Debug.dll!WinPumpMessages() Line 110	C++	Symbols loaded.
 	UnrealEditor-ApplicationCore-Win64-Debug.dll!FWindowsPlatformApplicationMisc::PumpMessages(bool bFromMainLoop) Line 141	C++	Symbols loaded.
 	UnrealEditor-Win64-Debug.exe!FEngineLoop::Tick() Line 5139	C++	Symbols loaded.
 	UnrealEditor-Win64-Debug.exe!EngineTick() Line 63	C++	Symbols loaded.
 	UnrealEditor-Win64-Debug.exe!GuardedMain(const wchar_t * CmdLine) Line 186	C++	Symbols loaded.
 	UnrealEditor-Win64-Debug.exe!LaunchWindowsStartup(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * __formal, int nCmdShow, const wchar_t * CmdLine) Line 272	C++	Symbols loaded.
 	UnrealEditor-Win64-Debug.exe!WinMain(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * pCmdLine, int nCmdShow) Line 330	C++	Symbols loaded.

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-150092 in the post.

0
Login to Vote

Fixed
ComponentUE - LD & Modeling - Terrain - Landscape
Affects Versions5.0
Target Fix5.1
Fix Commit20385698
Main Commit20385698
CreatedApr 25, 2022
ResolvedMay 27, 2022
UpdatedJun 8, 2022