First-chance Exception

I am getting a first-chance exception on a specific line of code and I have no idea on how to solve it. The class that calls this code inherits from AActor.

Exception Message:

First-chance exception at
0x000007FEE348E470
(UE4Editor-Engine.dll) in
UE4Editor.exe: 0xC0000005: Access
violation reading location
0x00000000000007C0.

Unhandled
exception at 0x000007FEE348E470
(UE4Editor-Engine.dll) in
UE4Editor.exe: 0xC0000005: Access
violation reading location
0x00000000000007C0.

Code:

FLinearColor cloudPanColor= FLinearColor(FVector(0.0f, -1.0f, 0.2f) * (this->()->GetTimeSeconds() * CloudSpeed));

That might be returning null, where is that line located?

I added the line of code below as a test and it threw the same error. The code is in a method which gets called from my Update method which gets called from my Tick method. Why would be returning null?

float seconds = this->()->GetTimeSeconds();

Your object probably does not have a World value, it needs to be a World Context object. I’m personnaly using the World reference of the GameInstance class.

You can from any point of UObject envriament GEngine->() as long as game is world context is initiated at that point

I tried using GEngine->(), but it causes the same problem.

Could you give some code on how to use the world reference of the GameInstance class so I can test it.