When you do evaluation ( in if,for ,etc. ), it's good practice to check for null first ,before you check for other cases:
if(form.getUserCreditCardNumber() == null || form. getUserCreditCardNumber() == ""){
//bla bla bla
}
it helps you to avoid NullPointerException in weird and unexpected situation.
No comments:
Post a Comment