Fixed #23555 -- Fixed IndexError problem in QuerySet.first()