Call to a member function getAvatar() on null