Re: EC subclass constructor trouble

Sacha Michel Mallais <[email protected]>
Newsgroups gmane.comp.web.webobjects.devel
Message-ID <[email protected]>
On Mar 29, 2006, at 11:28 AM, Zak Burke wrote:

> I have an EC class that extends EOEditingContext. Occasionally,  
> when creating a child EC of an existing EC, I get a NPE on the last  
> line of the constructor (see below). Any idea how that is possible?  
> I'm at a loss.
>
> init() is not a likely culprit; all it does is a single call to  
> super.setMessageHandler().
>
> zak.
>
>
> public I3pkbEditingContext(Session s, EOEditingContext ec)
> {
>     super(ec);
>     init();
>     User u = s.user();
>     if (u != null)
>         this.user = (User) EOUtilities.localInstanceOfObject(this, u);
> }

Is there any chance that s.user() returns a new user, one that has  
not been saved to the database?


sacha


-- 
Sacha Michel Mallais            800 kg gorilla
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65             AIM: smallais
1. Never tell everything at once.
-- Ken Venturi, Ken Venturi's Two Great Rules of Life
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.