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)
Expected: The DebugCamera would be turned off with no issue
Result: The project crashes
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
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-65105 in the post.