Developer Forum »
Relation-fields: Object reference not set to an instance of an object
62 posts

I have just updated a website to Webnodes version 1455. In edit, I get a "critical warning" when I try to select or create a new node in ALL the relation fields.

"Workflow terminated" - "Object reference not set to an instance of an object".

Any solution?

 

 

181 posts

Hi!

I'm not able to reproduce this error generally, so I'll be in touch to look at the site in question. It might be a site specific issue, and not a general Webnodes bug.

181 posts

I've looked at the code now, and the places where I was able to recreate the error (In the Kurs (Course) content class), on the Deltakere (Participants) relation, the error was due to a function that is executed in the OnNew method. The method had a line that used WAFContext. WAFContext is dependent on being used in a Web context, but when you click the New button, the node is created in a workflow context. 

The solution is very simple: Use the Session property on the node object, and not any context objects.

 

62 posts

Ok thank you! Now I got the chance to clean up some old code not longer in use ;)

1