Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Cannot read property 'value' of null" when component is destroyed #12

Closed
mstawick opened this issue Feb 1, 2017 · 4 comments
Closed
Labels

Comments

@mstawick
Copy link

mstawick commented Feb 1, 2017

This happens for both untouched captcha, and one that has been resolved.

TypeError: Cannot read property 'value' of null
at Object.mo [as getResponse] (https://www.gstatic.com/recaptcha/api2/r20170126104253/recaptcha__en_gb.js:298:137)
at RecaptchaComponent.reset (eval at ./node_modules/ng2-recaptcha/recaptcha/recaptcha.component.js (http://localhost:8000/app.1.js:11315:1), :38:33)
at RecaptchaComponent.ngOnDestroy (eval at ./node_modules/ng2-recaptcha/recaptcha/recaptcha.component.js (http://localhost:8000/app.1.js:11315:1), :33:14)

@mstawick
Copy link
Author

mstawick commented Feb 1, 2017

And seems to work fine when I remove:

       if (this.grecaptcha.getResponse(this.widget)) {
          // Only emit an event in case if something would actually change.
          // That way we do not trigger "touching" of the control if someone does a "reset"
          // on a non-resolved captcha.
          this.resolved.emit(null);
        }

from reset() of RecaptchaComponent

@DethAriel DethAriel added the bug label Feb 1, 2017
@DethAriel
Copy link
Owner

I will take a look at that later today. If this is a blocker, I suggest you to downgrade to v1.5.1

@DethAriel
Copy link
Owner

Please, update to v1.5.4

@mstawick
Copy link
Author

mstawick commented Feb 2, 2017

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants