Prevent Query For User When No Session Available

Hi, I am optimizing our web application right now and found one query which is executed every time a page is called. However, this query is absolutely useless when no user is logged in. The following query is executed:

system.db.CDbCommand.query(SELECT * FROM user t WHERE t.id IS NULL LIMIT 1)

How can I prevent Yii from looking up a user with the id null? I am using the rights Module from Christoffer Niska which extends the standard functions of Yii user.

Thanks for help!