• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Strange Exception less useless, but no less Strange
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Strange Exception less useless, but no less Strange (From: Andrew Kinnie <email@hidden>)

  • Prev by Date: Strange Exception less useless, but no less Strange
  • Next by Date: Re: Strange Exception less useless, but no less Strange
  • Previous by thread: Strange Exception less useless, but no less Strange
  • Next by thread: Re: Strange Exception less useless, but no less Strange
  • Index(es):
    • Date
    • Thread