• 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: Sophisticated relationship help
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sophisticated relationship help


  • Subject: Re: Sophisticated relationship help
  • From: Art Isbell <email@hidden>
  • Date: Sun, 26 Feb 2006 21:00:43 -1000

On Feb 26, 2006, at 5:49 PM, David LeBer wrote:

On 26-Feb-06, at 10:33 PM, Jim Wong wrote:

can't seem to get it to work. I don't get it. There's still an error.
return anOpportunity.companies().containsObject ( currentCompany );
this statement doesn't invoke. it returns a nullpointer exception. Why?

One of the items in that method chain is nulling out and it shouldn't.

You're going to have to break the line code apart and figure it out.

Or run under the Java debugger, set a breakpoint at that statement, and examine the value of anOpportunity which seems likely to be the culprit. If it's not null, its companies() relationship could be empty, but shouldn't be null. containsObject() isn't documented to throw a null pointer exception if its argument is null, but the value of currentCompany should also be checked just in case.


Finding out what's null when it shouldn't be probably won't be as difficult as figuring out why the object is null. But you have to figure out what's null first. Learning how to debug such common problems will save you lots of time because you will no longer depend on others to help you debug.

Aloha,
Art

_______________________________________________
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: 
 >WOCheckBox Howto? (From: Jim Wong <email@hidden>)
 >Re: WOCheckBox Howto? (From: Mark Morris <email@hidden>)
 >Sophisticated relationship help (From: Jim Wong <email@hidden>)
 >Re: Sophisticated relationship help (From: Art Isbell <email@hidden>)
 >Re: Sophisticated relationship help (From: Jim Wong <email@hidden>)
 >Re: Sophisticated relationship help (From: Mark Morris <email@hidden>)
 >Re: Sophisticated relationship help (From: Michael Warner <email@hidden>)
 >Re: Sophisticated relationship help (From: Jim Wong <email@hidden>)
 >Re: Sophisticated relationship help (From: David LeBer <email@hidden>)

  • Prev by Date: Re: Sophisticated relationship help
  • Next by Date: Re: Sophisticated relationship help
  • Previous by thread: Re: Sophisticated relationship help
  • Next by thread: Re: Sophisticated relationship help
  • Index(es):
    • Date
    • Thread