Skip to content

Commit 7722748

Browse files
committed
swagger: avoid errors when using invalid rapi-doc fragment ids matcornic#465
1 parent fd1c03b commit 7722748

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

static/js/theme.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -803,12 +803,14 @@ function scrollToFragment() {
803803
return;
804804
}
805805
window.setTimeout(function(){
806-
var e = document.querySelector( window.location.hash );
807-
if( e && e.scrollIntoView ){
808-
e.scrollIntoView({
809-
block: 'start',
810-
});
811-
}
806+
try{
807+
var e = document.querySelector( window.location.hash );
808+
if( e && e.scrollIntoView ){
809+
e.scrollIntoView({
810+
block: 'start',
811+
});
812+
}
813+
} catch( e ){}
812814
}, 10);
813815
}
814816

0 commit comments

Comments
 (0)