Fix MySQL bug when doing a select on a null userid (when not logged in).