Skip to content

Commit 1a91440

Browse files
committed
Avoid "Cannot call method 'replace' of undefined" error
1 parent 2a141c2 commit 1a91440

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/jquery.smooth-scroll.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ $.fn.extend({
145145
scrollTarget: thisOpts.scrollTarget || thisHash,
146146
link: link
147147
});
148+
148149
$.smoothScroll( clickOpts );
149150
}
150151
});
@@ -232,6 +233,7 @@ $.smoothScroll = function(options, px) {
232233

233234
$.smoothScroll.version = version;
234235
$.smoothScroll.filterPath = function(string) {
236+
string = string || '';
235237
return string
236238
.replace(/^\//,'')
237239
.replace(/(?:index|default).[a-zA-Z]{3,4}$/,'')

0 commit comments

Comments
 (0)