Re: Sophisticated relationship help
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