NullReferenceException
Posted: Sat Jun 22, 2019 12:10 pm
I have two instances where if I try to run the program on specific Screens the program throws a NullReferenceException on an Object - yet if I change to a different screen in IX Developer and run the code it works just fine.
The weird one is I am not sure why it is throwing this exception. In the first case it is a ScriptModule where I have created a Dictionary. In one of the functions I am trying to get the size of the Dictionary using Dictionary.Count. I assumed that this was due to a newly defined Dictionary with no entries causing this problem when the Count is called. The issue is from everything I read a newly defined Dictionary will give a count of 0 from the start.
The second is on another screen where I am checking to see if the user has entered some information on click of a button. The tag attached to the input field is a string and on button push I am checking if the string is Null or empty. Apparently checking to see if a tag is Null or empty seems to throw this exception.
The weird one is I am not sure why it is throwing this exception. In the first case it is a ScriptModule where I have created a Dictionary. In one of the functions I am trying to get the size of the Dictionary using Dictionary.Count. I assumed that this was due to a newly defined Dictionary with no entries causing this problem when the Count is called. The issue is from everything I read a newly defined Dictionary will give a count of 0 from the start.
The second is on another screen where I am checking to see if the user has entered some information on click of a button. The tag attached to the input field is a string and on button push I am checking if the string is Null or empty. Apparently checking to see if a tag is Null or empty seems to throw this exception.