Skip to content
This repository was archived by the owner on Feb 17, 2021. It is now read-only.

Commit cfc71c6

Browse files
author
Timothy Lindvall
committed
Add sanity check to ensure tour exists.
1 parent 9e25349 commit cfc71c6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/js/hopscotch.js

+5
Original file line numberDiff line numberDiff line change
@@ -1831,6 +1831,11 @@
18311831
// from window onLoad handler, we'll use currTour)
18321832
if (!currTour) {
18331833

1834+
// Sanity check! Is there a tour?
1835+
if(!tour){
1836+
throw new Error('Tour data is required for startTour.');
1837+
}
1838+
18341839
// Check validity of tour ID. If invalid, throw an error.
18351840
if(!tour.id || !validIdRegEx.test(tour.id)) {
18361841
throw new Error('Tour ID is using an invalid format. Use alphanumeric, underscores, and/or hyphens only. First character must be a letter.');

0 commit comments

Comments
 (0)