« Return to Thread: new returns null?

new returns null?

by Ken T. :: Rate this Message:

Reply to Author | View in Thread

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.

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


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

    http://xircles.codehaus.org/manage_email


 « Return to Thread: new returns null?