Error with RegistrationResult

I was working with the authentication . register and it work with no problems but then today I keep seeing a error when the user create an accountwhile using the code below.

return authentication.register(email, password, options)
        .then((member) => {
            console.log('Member registered and waiting for approval:', registrationResult);
        .catch((error) => {
            // Error keeps appearing: Cannot read properties of null (reading 'member')


Error msg says: 
Cannot read properties of null (reading 'member')

This doesn’t stops the user from creating an account but I cant run the next part of the code because the code keeps catching an error.

I need help with this.