Skip to content

Commit 53e8937

Browse files
authored
Merge pull request cferdinandi#445 from cferdinandi/bolt-design-system-master
Bolt design system master
2 parents 07fef21 + e1ef66c commit 53e8937

10 files changed

+33
-18
lines changed

dist/smooth-scroll.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* smooth-scroll v14.2.0: Animate scrolling to anchor links
2+
* smooth-scroll v14.2.1: Animate scrolling to anchor links
33
* (c) 2018 Chris Ferdinandi
44
* MIT License
55
* http://github.com/cferdinandi/smooth-scroll
@@ -525,6 +525,9 @@
525525
* Animate scroll on popstate events
526526
*/
527527
var popstateHandler = function (event) {
528+
// Stop if history.state doesn't exist (ex. if clicking on a broken anchor link).
529+
// fixes `Cannot read property 'smoothScroll' of null` error getting thrown.
530+
if (history.state === null) return;
528531

529532
// Only run if state is a popstate record for this instantiation
530533
if (!history.state.smoothScroll || history.state.smoothScroll !== JSON.stringify(settings)) return;
@@ -630,4 +633,4 @@
630633

631634
return SmoothScroll;
632635

633-
}));
636+
}));

dist/smooth-scroll.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/smooth-scroll.polyfills.js

100755100644
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* smooth-scroll v14.2.0: Animate scrolling to anchor links
2+
* smooth-scroll v14.2.1: Animate scrolling to anchor links
33
* (c) 2018 Chris Ferdinandi
44
* MIT License
55
* http://github.com/cferdinandi/smooth-scroll
@@ -595,6 +595,9 @@ if (window.Element && !Element.prototype.closest) {
595595
* Animate scroll on popstate events
596596
*/
597597
var popstateHandler = function (event) {
598+
// Stop if history.state doesn't exist (ex. if clicking on a broken anchor link).
599+
// fixes `Cannot read property 'smoothScroll' of null` error getting thrown.
600+
if (history.state === null) return;
598601

599602
// Only run if state is a popstate record for this instantiation
600603
if (!history.state.smoothScroll || history.state.smoothScroll !== JSON.stringify(settings)) return;
@@ -700,4 +703,4 @@ if (window.Element && !Element.prototype.closest) {
700703

701704
return SmoothScroll;
702705

703-
}));
706+
}));

0 commit comments

Comments
 (0)