I am writing an Observer to Magento\Customer\Account\Index
but the Objects from class \Magento\Customer\Model\Customer
return null when getExtensionAttributes is executed.
$customer = $customerFactory->create()->load($customerID);
//$customerRepository->get($customerID);
$ext = $customer->getExtensionAttributes();
if($ext == null){
throw new \Exception(" var ext = null");
}
I used CustomerRepository and CustomerFactory to get $customer