Hi there everyone!
I think the above solutions would definitely solve the problem (Since you won’t be accessing a null pointer anymore) but I’m not sure that’s the right way to go.
I’d like to pitch an alternate solution that doesn’t involve changing the engine, especially for any of ya’ll using binary versions of Unreal.
The issue likely occurs because at some point in your code you’ve started a Smart Object Gameplay Behavior Task such as “MoveToAndUseSmartObjectWithGameplayBehavior”.
When that task is active (eg. movement in progress) and you close your Play in Editor or Client session that’s when you hit the crash. It’s crashing because it’s attempting to clean up that task but the World it existed in and/or SmartObjectSubsystem have already been cleaned up.
The easy fix is to add blueprint code in the place you spawn the task to end it on Destroy/Exit/Completed.
For example if you spawn a MoveToAndUseSmartObjectWithGameplayBehavior task inside a State Tree Task Blueprint via Event Enter State then make sure you store a reference to it.
Now add Event ExitState to that same Blueprint and call EndTask on the stored task
This cleans up your in-progress task at the right time during shutdown/exit and you won’t hit the crash anymore

