on 09-08-2010 12:46 PM
Dear SDN,
I am trying to retrieve the attribute value of an attribute by using the following line of code
wdContext.nodenumberABC().getCurrentElement().getAttributeValue("number1").toString();
if when there is some value in the attribute it is able to retrieve the value, but when there is no value it is throwing the nullpointer exception.
I tried using try and catch to get hold of this but application is having poor performance taking some time to load.
can somebody please point me in a correct way of handling the null values without effecting the performance of the application
Appriciate your help
Thanks
RAD
Hi,
Check if the object is null before u write this statement:
if(wdContext.nodenumberABC().getCurrentElement() != null)
{
wdContext.nodenumberABC().getCurrentElement().getAttributeValue("number1").toString();
}
or even try this code:
if(wdContext.currentnumberABCElement() != null)
{
wdContext.currentnumberABCElement() .getAttributeValue("number1").toString();
}
Regards,
Poojith MV
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.