<<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.