on 03-30-2006 12:15 PM
In my wd Appln i am invoking a RFC.and my context has the following structure.
Context-->inp1
outputnode
output1
output2
I have bound this three attributes to three input fields.
There is a scenario where i have to check if the output1 is empty or not before the rfc is invoked.
When i write the following code it gives me null pointer exception
if(wdContext.currentOutputNodeElement.getOutput1().equals(""))
then i also checked if the output1 is null or not
if(wdContext.currentOutputNodeElement.OUTPUT1 == null) even this gave me null pointer exception.
can u please tell me what exactly is null here .
There is no problem when the response has come from rfc only crashing if accessed before getting response from RFC
Hi,
Why are you binding input to output nodes?
Anyhoos, you'll probably find that your nodes are null, try:
if(wdContext.nodeOutput1()==null)
If the node itself is null then testing if it holds a null attribute will throw the null pointer exception.
I hope this helps,
Patrick.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Nilesh,
Correct check should looks like:
final I<ControllerName>.IInp1Element elIn
= wdContext.currentInp1Element();
final I<ControllerName>.IOutputNodeElement elOut
= null == elIn ? null : wdContext.currentOutputNodeElement();
if ( null != elOut && null != elOut.getOutput() &&
elOut.getOutput().length() > 0 )
{
/* code here */
}
VS
Message was edited by: Valery Silaev
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nilesh,
For checking output1 empty:
For String it is null, if its going to be an integer then its 0.
<b>if(wdContext.currentOutputNodeElement.getOutput1()==null)</b>
Hope it helps,
Regards,
Nagarajan.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
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.