Call to a member function getCfg() on null