Skip to Content
0
Former Member
Feb 23, 2006 at 11:02 AM

Null pointer Exception while setting a value

35 Views

Hi,

Im trying to move the contents of a model node into a Value node. But I am getting a null pointer exception.

Here is my structure

Source node:

<Model Node>

-


<Output Node>

-


<Li Node> (li_Shipper)

-


<Model Attribute>

Destination node

<Model Node>

-


<Output Node>

-


<Li Node> (li_Allocations)

-


<Value Node> (Shipper_DD) 0..1 singleton-false

-


<Value Attribute> (Shipper)

My code is as follows:

for (int i=0; i<wdContext.nodeLi_Allocations().size();i++)

{

WDCopyService.copyElements(wdContext.nodeLi_Shipper(),wdContext.nodeLi_Allocations().getLi_AllocationsElementAt(i).nodeShipper_DD());

// Here im trying to assign a default value. Im getting the null pointer exception in this line.

wdContext.nodeLi_Allocations().getLi_AllocationsElementAt(i).nodeShipper_DD().currentShipper_DDElement().setShipper(wdContext.nodeLi_Allocations().getLi_AllocationsElementAt(i).getShipper());

}

Can anyone tell me how I can rectify this?