Baffling nullptr bug

In my plugin I create a new node object using this line of code.

Node = NewObject<UQuestGraphNode_Action>(QuestGraph, UQuestGraphNode_Action::StaticClass());

This line crashes and complains about a nullptr. I am completely stumped. As far as I can tell, i’m not even trying to access any pointers, so I have no idea why it would complain about a nullptr.

I have also tried instantiating the Node in this way, with no fix either.

Node = NewObject<UQuestGraphNode_Action>(QuestGraph);

Any help would be appreciated, thank you.

i guess you checked if “QuestGraph” wasn’t null (anyway it should throw an assert and not a classic access violation )

Could you tell us more, is it at the beginning of a method ? did you checked if the object you call this code on is not null ?
could you show the few lines before and after this call ?