Call to a member function getEvent() on bool