0

I have Overrrided the v1/customers rest api and added in my custom module the method CreateAccount() in my model file and the file is working fine when checking postman

But while creating a customer it is giving an errors like below

Can you please help me out on this.

Fatal error: Uncaught Error: Call to a member function getValue() on null in vendor/magento/module-customer/Model/AccountManagement.php: 811 Stack trace: #0 vendor/magento/module-customer/Model/AccountManagement.php(745): Magento\Customer\Model\AccountManagement->getMinPasswordLength() #1 app/code/vendor/CustomApi/Model/AccountManagement.php(513): Magento\Customer\Model\AccountManagement->checkPasswordStrength('Password6') #2 /var/www/html/magento2/generated/code/Meetanshi/CustomApi/Model/AccountManagement/Interceptor.php(24): Meetanshi\CustomApi\Model\AccountManagement->createAccount(Object(Magento\Customer\Model\Data\Customer), 'Password6', '') #3 [internal function ]: Meetanshi\CustomApi\Model\AccountManagement\Interceptor->createAccount(Object(Magento\Customer\Model\Data\Customer), 'Password6', '') #4 /var/www/html/magento2/vendor/magento/module-webapi/Controller/Rest/SynchronousRequestProcessor.php(95): call_user_func_array(Array, Array) #5 vendor/magento/module-customer/Model/AccountManagement.php on line 811
{ "messages": { "error": [ { "code": 500, "message": "Fatal Error: 'Uncaught Error: Call to a member function getValue() on null in /var/www/html/magento2/vendor/magento/module-customer/Model/AccountManagement.php:811\nStack trace:\n#0 /var/www/html/magento2/vendor/magento/module-customer/Model/AccountManagement.php(745): Magento\Customer\Model\AccountManagement->getMinPasswordLength()\n#1 /var/www/html/magento2/app/code/Meetanshi/CustomApi/Model/AccountManagement.php(513): Magento\Customer\Model\AccountManagement->checkPasswordStrength('Password6')\n#2 /var/www/html/magento2/generated/code/Meetanshi/CustomApi/Model/AccountManagement/Interceptor.php(24): Meetanshi\CustomApi\Model\AccountManagement->createAccount(Object(Magento\Customer\Model\Data\Customer), 'Password6', '')\n#3 [internal function]: Meetanshi\CustomApi\Model\AccountManagement\Interceptor->createAccount(Object(Magento\Customer\Model\Data\Customer), 'Password6', '')\n#4 /var/www/html/magento2/vendor/magento/module-webapi/Controller/Rest/SynchronousRequestProcessor.php(95): call_user_func_array(Array, Array)\n#5 /var/ww' in '/var/www/html/magento2/vendor/magento/module-customer/Model/AccountManagement.php' on line 811", "trace": "Trace is not available." } ] }

1
  • Can you please share your di.xml and your custom code? Aug 20 at 12:28
0

It seems in which object you are calling the getValue() having nothing to operate. Just print the data and verify if you have some data to operate.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.