google-pay / google-pay-button

Google Pay button - React, Angular, and custom element
Apache License 2.0
250 stars 60 forks source link

fix: do not reference undefined google during component mounting #220

Closed dmengelt closed 1 year ago

dmengelt commented 1 year ago

Without returning from the mount() function if there was an error loading pay.js we continue to call this.updateElement(); this will result in trying to reference the undefined google object:

https://github.com/google-pay/google-pay-button/blob/812855408177dfa7a022849566bdd298ed477231/src/lib/button-manager.ts#L231

fixes #219

JlUgia commented 1 year ago

LGTM FYI @socsieng