« Return to Thread: new returns null?

Re: Re: new returns null?

by Daniel Honig :: Rate this Message:

Reply to Author | View in Thread

Did we get a bug-report zip yet?

New definitely should never return null....



On Sat, Jul 4, 2009 at 9:40 PM, Ken T. <ktectropy@...> wrote:
On Fri, 03 Jul 2009 12:08:15 +0000, Ken T. wrote:

> I've got an action in a controller that looks like this:
>
>     def create = {
>         def instance = new MyClass()
>         instance.properties = params
>         def subject = SecurityUtils.getSubject() instance.author =
>         User.findByUsername(subject.getPrinciple()) return
>         ['instance':instance]
>     }
>
> The class, MyClass, is a domain class.  Nothing particularly special
> here.  It has a few constraints and four fields.
>
> The problem I'm having is that right after assignment the variable
> instance is null.  Shouldn't new always returns something here?
>
> Thanks.

I'm not sure what the problem was, but it is worked out now.  Thanks for
the help!



--
Ken T. <ktectropy@...>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email



 « Return to Thread: new returns null?