My widget is working but still get an error

You need to click this

338798-screenshot-1.jpg

It will take you to the offending node. No matter what you think your code might be doing, you are passing this node an empty reference.