visual basic 2013 System.nullreferenceException How to catch a nothing ?

Hello Experts,
my programs opens a site and operates it perfectly only after some five or six good executions it shows the error message shown in the image.

some times the site is faster sending the data and some times its slower, I gues this creates the probem and sometimes the variable v3 is nothing.... until the next iteration.... so how can I catch  a "nothing" without getting an error message ?

Best regards.
system-nulreferenceException.jpg
RGuillermoProject ManagerAsked:
Who is Participating?
 
Fernando SotoRetiredCommented:
Hi rguillermo;

It is hard to tell from the code that is posted. You can two one of two things if v3 is really Nothing then this should work.
If v3 Is Nothing then 

Open in new window

But if v3 is not the one causing the null reference then this should work.
If v3.activeElement Is Nothing

Open in new window

0
 
RGuillermoProject ManagerAuthor Commented:
Fernando the
If v3.activeElement Is Nothing
Worked perfectly!
Thank you very much!!
0
 
Fernando SotoRetiredCommented:
Not a problem rguillermo, glad to help.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.