That should not happen... As of my understanding on JScript.
Well here's another way.
You can enclose in a try-catch block too. But before that please run this test widget.
Attachment:
File comment: Test
ObjTest.XWidgetPkg [6.27 KiB]
Downloaded 190 times
It includes all the procedures used in JS that to detect the validity of an object. Please go through the code-behind.
Run the test. If it is successful it will write success. If any error is thrown, it will show error. In this case I'll assume that your script engine and/or some other code has a problem, coz that's the only way to test it. Try running my code and say.
SUGGESTION: A good program (here widget) never manipulates on non existent, uninitialized or nulled objects. I wonder what's your requirement.

Looking forward for your widget to complete...
