You don't need to change this now, but this whole block should be replaced by something like:

@groups = Group.where(:reader => @authenticated_user)

I haven't tried it but I think it takes care of ignoring nil, and it is more efficient.