Call to a member function getFile() on null