Getting "Call to a member function getFirstname() on null" and "Call to a member function getLastname() on null" for both $profile->getBillingAddress() and $profile->getShippingAddress().
It used to be working on X-Cart version 5.5.1.6. Getting this error on X-Cart version 5.5.1.8.
Facing the same error for getCountry, getState, getCity and getZipcode function.
First of all, please make sure the customer profile does have data such as firstname, address fields, etc. associated with the account. You might be trying to call data out of an empty (just username & password and no profile data) account.