Re: Strange Exception less useless, but no less Strange
Re: Strange Exception less useless, but no less Strange
- Subject: Re: Strange Exception less useless, but no less Strange
- From: Travis Britt <email@hidden>
- Date: Sun, 20 Mar 2005 13:33:04 -0500
On Mar 20, 2005, at 1:12 PM, Andrew Kinnie wrote:
I get a null pointer exception on this line:
String club = clubName();
/* this line: */
if(club.equals("A Club Name")){
Note that the clubName() method is an EOModeler generated method:
public String clubName(){
return (String)storedValueForKey("clubName");
}
So clubName() returns null in at least one case, and when you try to
send the "equals()" message to the club obj a NPE is tossed up.
I haven't been tracking this thread, but it appears your production
data includes at least one row that's missing a value for clubName. If
that's a valid possible state for the data then you'd need to check for
null in your code.
tb
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden