Description

Toggling the Debug Camera with the UCheatManager::ToggleDebugCamera() function in a PlayerController derived class causes a crash.

 

Tested in 4.19.2 (CL - 4033788), 4.20.3 (CL - 4369336), 4.21 (CL - 4450172), 4.22 (CL - 4450599)

Steps to Reproduce
  1. Download the attached project
  2. Open the level in the ContentBrowser
  3. Create a blank WidgetBlueprint, named NewWidgetBlueprint
  4. Open the PlayerController_BP Player Controller Blueprint
  5. Set the My Widget Asset to NewWidgetBlueprint and save
  6. PIE

Expected: The DebugCamera would be turned off with no issue

Result: The project crashes

Callstack

LoginId:5964f8f84766f4b976277180442869c1
EpicAccountId:d237bdd466454ba6a10848877d154538

Fatal error: [Link Removed] [Line: 10] Cast of nullptr to LocalPlayer failed

UE4Editor_Core!FDebug::AssertFailed() [d:\build\++ue4\sync\engine\source\runtime\core\private\misc\assertionmacros.cpp:425]
UE4Editor_CoreUObject!CastLogError() [d:\build\++ue4\sync\engine\source\runtime\coreuobject\private\templates\casts.cpp:11]
UE4Editor_Engine!FLocalPlayerContext::SetPlayerController() [d:\build\++ue4\sync\engine\source\runtime\engine\private\localplayer.cpp:164]
UE4Editor_Engine!FLocalPlayerContext::FLocalPlayerContext() [d:\build\++ue4\sync\engine\source\runtime\engine\private\localplayer.cpp:81]
UE4Editor_UMG!UWidget::HasUserFocus() [d:\build\++ue4\sync\engine\source\runtime\umg\private\components\widget.cpp:473]
UE4Editor_Engine!AActor::DispatchBeginPlay() [d:\build\++ue4\sync\engine\source\runtime\engine\private\actor.cpp:3210]
UE4Editor_Engine!AWorldSettings::NotifyBeginPlay() [d:\build\++ue4\sync\engine\source\runtime\engine\private\worldsettings.cpp:230]
UE4Editor_Engine!AGameStateBase::HandleBeginPlay() [d:\build\++ue4\sync\engine\source\runtime\engine\private\gamestatebase.cpp:177]
UE4Editor_Engine!UWorld::BeginPlay() [d:\build\++ue4\sync\engine\source\runtime\engine\private\world.cpp:3699]
UE4Editor_Engine!UGameInstance::StartPlayInEditorGameInstance() [d:\build\++ue4\sync\engine\source\runtime\engine\private\gameinstance.cpp:400]
UE4Editor_UnrealEd!UEditorEngine::CreatePIEGameInstance() [d:\build\++ue4\sync\engine\source\editor\unrealed\private\playlevel.cpp:3298]
UE4Editor_UnrealEd!UEditorEngine::PlayInEditor() [d:\build\++ue4\sync\engine\source\editor\unrealed\private\playlevel.cpp:2433]
UE4Editor_UnrealEd!UEditorEngine::StartQueuedPlayMapRequest() [d:\build\++ue4\sync\engine\source\editor\unrealed\private\playlevel.cpp:1268]
UE4Editor_UnrealEd!UEditorEngine::Tick() [d:\build\++ue4\sync\engine\source\editor\unrealed\private\editorengine.cpp:1605]
UE4Editor_UnrealEd!UUnrealEdEngine::Tick() [d:\build\++ue4\sync\engine\source\editor\unrealed\private\unrealedengine.cpp:403]
UE4Editor!FEngineLoop::Tick() [d:\build\++ue4\sync\engine\source\runtime\launch\private\launchengineloop.cpp:3495]
UE4Editor!GuardedMain() [d:\build\++ue4\sync\engine\source\runtime\launch\private\launch.cpp:166]
UE4Editor!GuardedMainWrapper() [d:\build\++ue4\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:144]
UE4Editor!WinMain() [d:\build\++ue4\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:223]
UE4Editor!__scrt_common_main_seh() [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:283]
kernel32
ntdll

Have Comments or More Details?

There's no existing public thread on this issue, so head over toAnswerHub just mention UE-65105 in the post.

0
Login to Vote

Fixed
ComponentGameplay
Affects Versions4.19.24.214.224.20.3
Target Fix4.21
Fix Commit4529585
Main Commit4551290
Release Commit4529585
CreatedOct 11, 2018
ResolvedOct 31, 2018
UpdatedApr 3, 2019