Skip to content

Commit 8865b8f

Browse files
committed
prevent syntax error when invalid hash is given
1 parent ecf76af commit 8865b8f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

web/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -915,7 +915,7 @@
915915
// scroll to a section, without changing the browser history
916916

917917
function scrollToId(hash) {
918-
if(hash && hash != '') {
918+
if(hash && hash != '' && document.getElementById(hash) !== null) {
919919
var offset = $('#' + hash).offset();
920920
if(typeof offset !== 'undefined')
921921
$('html, body').animate({ scrollTop: offset.top }, 0);

0 commit comments

Comments
 (0)