Call to a member function getName() on null