<<thread split from here>>

You'd compare an object to null with == . I think you want one of the following. It's hard to determine the exact behavior you're looking for from your code.

if (child == null)
    child = new Lista(c, null);

// Or:

if (child.getData() == null)
    child = new Lista(c, null);

Hi. I have a similar problem where the test works fine if its the 2nd time a user tries to select an account.

if the user types in an incorrect account number the first time it should go back to the homepage.

if ((user.getSelectedSoldTo().equals(null)) && (user.getSelectedShipTo().equals(null)))
				{
					String address=MyAccountConstants.MYACCOUNT_HOMEPAGE;
					//"??????????????"; 	//some failure page
					gotoPage(address,request,response); 
				} else {
					String address=MyAccountConstants.USER_SAVE; 
					gotoPage(address,request,response);
				}

It does HomePage only if selected as incorrect account the 2nd time. first time it throws the NullPointerException.

Any help is appreciated.

If it throws NullPointerException then something is null. Look at the error message to find the line that this happens. Then try to print the values of the objects used to see what is null.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.