[core] Bug Fix: User.findByUsername should handle null values