IsInGameThread Exception thrown

You could try encapsulating the code in

if(IsInGameThread()){
   if (GIsGameThreadIdInitialized){
     // code here
   }
}

Though I’m sure it will fire inside of FRunnable on a different thread. You would have to check with a breakpoint

You’d probably need
include “CoreGlobals.h”
if it’s not included by default.