Call to a member function getGradeCode() on null