Error 500: Internal Server Error

Call to a member function getCategory() on null