on 08-26-2008 10:23 AM
Hi
I am trying to clear t he context by using
wdContext.invalidate().
However if no information is avaiable yet, I get null pointer exception. How do I check if a null object exists
before running wdContext.invalidate()?
thanks
yuval
Please note that NullPointerException is thrown when an object is not instantiated, so you need to check for that object variable.
if (wdContext != null)
wdContext.invalidate();
@Sudhir and Ayyapparj
You will get NullPointerException even if you write this:
if(!wdContext.isEmpty())
because wdContext is not instantiated.
Jawed Ali
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Just see if this fulfill your requirement:
wdContext.getContext().reset(true);
Regards,
Murtuza
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
use as follows
if(!wdContext.isEmpty())
wdContext.invalidate();
Regards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
post the stack trace of the error.
Thanks,
ramesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can check wdContext.isEmpty();
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.