Some times My UIPath shows me object reference error message but my code and Sequence is coorect

Hey guys here is my new question.
my question is that

my code and sequence is correct and logic also right and program runs correctly but some time its shows me error message i.e object reference not set an instance of n object

please help me out

Hi @swanand_deshmukh,
Errors like this mostly means that there is somewhere variable without assignment or there is assignment to the variable which doesn’t exist. Please check every variable you have in the project. Do you have any OCR or Image Based activities in the project?

1 Like

Hi,

Always use "Convert.Tostring(“yourObject”), this will avoid this issue, it will handle null values.

2 Likes

@swanand_deshmukh, this will happen because of null value.
If you print in out put log before this statement in your code, you can see null value.
Please investigate why you are getting null value. that will resolve this problem.

2 Likes

You are probably trying to invoke that Workflow that has some in_Arguments, and hence those arguments are NULL because you are not invoking from the Main.xaml

2 Likes

i use .Tostring also it gives that error

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.