Skip to content

Commit c338455

Browse files
Merge pull request #1 from harshithmullapudi/patch-1
Send undefined if the next element doesn't exist
2 parents 4773051 + 593e8b9 commit c338455

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

intro.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@
422422
var continueStep = true;
423423

424424
if (typeof (this._introBeforeChangeCallback) !== 'undefined') {
425-
continueStep = this._introBeforeChangeCallback.call(this, nextStep.element);
425+
continueStep = this._introBeforeChangeCallback.call(this, nextStep && nextStep.element);
426426
}
427427

428428
// if `onbeforechange` returned `false`, stop displaying the element
@@ -463,7 +463,7 @@
463463
var continueStep = true;
464464

465465
if (typeof (this._introBeforeChangeCallback) !== 'undefined') {
466-
continueStep = this._introBeforeChangeCallback.call(this, nextStep.element);
466+
continueStep = this._introBeforeChangeCallback.call(this, nextStep && nextStep.element);
467467
}
468468

469469
// if `onbeforechange` returned `false`, stop displaying the element

0 commit comments

Comments
 (0)