Skip to content

Commit d488560

Browse files
committed
Fix issue where iframe could be undefined in integration tests
1 parent 79676c2 commit d488560

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

addon/components/stripe-element.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ export default Component.extend({
4545
// Fetch autofocus, set by user
4646
let autofocus = get(this, 'autofocus');
4747
let stripeElement = get(this, 'stripeElement');
48-
if (autofocus) {
49-
this.$('iframe')[0].onload = () => {
48+
let $iframe = this.$('iframe')[0];
49+
if (autofocus && $iframe) {
50+
$iframe.onload = () => {
5051
stripeElement.focus();
5152
};
5253
}

0 commit comments

Comments
 (0)