Ошибка (Error): Call to a member function getParentId() on null