Exception:Call to a member function getPrice() on null