Calling method GetOwner()->GetName() crash editor

After this strings in code all tries to play level crashinfg editor.

UE_LOG(LogTemp, Warning,
TEXT(“Position report reporting for
%s.”), *(GetOwner()->GetName()) );


FString ActorName =
GetOwner()->GetName(); UE_LOG(LogTemp,
Warning, TEXT(“Position report
reporting for %s.”), *ActorName );

It does so happened to me. I’m also waiting for the answer of this question.

I’m not sure but when I user this calling method not in ‘Initiate’ method, the problem does not happened.
So maybe the problem is not about what GetOwner() does, but is where and when you call it.
Try to call it in other method like BeginPlay() or etc.
I hope this will give you some help.

I did try running the code on UE4.13.0.
On BeginPlay() it works fine. But when running in the class constructor or in the TickComponent(…) method it crashed.
To recover you have to adjust the code back in the BeginPlay() and compile using an IDE like Visual Studio or XCode. Then the project opens again.

void UPositionReport::BeginPlay()
	FString ObjectName = GetOwner()->GetName();
	UE_LOG(LogTemp, Warning, TEXT("Position Report reporting on %s"), *ObjectName);


void UPositionReport::BeginPlay()

	UE_LOG(LogTemp, Warning, TEXT("Position Report reporting on %s"), *GetOwner()->GetName());

Console Output:

Recompiling Test...
Launching UnrealBuildTool... [J:/programs/Epic Games/4.13/Engine/Binaries/DotNET/UnrealBuildTool.exe Test -ModuleWithSuffix Test 5146 Win64 Development -editorrecompile -canskiplink "J:/UE4/03_Test/Test/Test.uproject"  -2015]
Warning: Starting HotReload took  0.0s.
CompilerResultsLog: New page: Compilation - Nov 2, 2016, 11:06:51 AM
CompilerResultsLog: Info Creating makefile for hot reloading Test (working set of source files changed)
CompilerResultsLog: Info Compiling game modules for hot reload
CompilerResultsLog: Info Parsing headers for TestEditor
CompilerResultsLog: Info   Running UnrealHeaderTool "J:\UE4\03_Test\Test\Test.uproject" "J:\UE4\03_Test\Test\Intermediate\Build\Win64\TestEditor\Development\TestEditor.uhtmanifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors -installed
CompilerResultsLog: Info Reflection code generated for TestEditor in 4.7757313 seconds
CompilerResultsLog: Info Performing 2 actions (4 in parallel)
CompilerResultsLog: Info PositionReport.cpp
CompilerResultsLog: Info [2/2] Link UE4Editor-Test-5146.dll
CompilerResultsLog: Info    Creating library J:\UE4\03_Test\Test\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-Test-5146.lib and object J:\UE4\03_Test\Test\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-Test-5146.exp
CompilerResultsLog: Info Total build time: 11.83 seconds
LogMainFrame: MainFrame: Module compiling took 12.317 seconds
LogContentBrowser: Native class hierarchy updated for 'Test' in 0.0013 seconds. Added 2 classes and 2 folders.
Display: HotReload successful (0 functions remapped  0 scriptstructs remapped)
LogContentBrowser: Native class hierarchy populated in 0.0118 seconds. Added 2145 classes and 421 folders.
Display: HotReload took 12.5s.