swagger: avoid errors when using invalid rapi-doc fragment ids #465

This commit is contained in:
Sören Weber 2023-02-04 13:39:59 +01:00
parent fd1c03b82f
commit 7722748432
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D

View file

@ -803,12 +803,14 @@ function scrollToFragment() {
return; return;
} }
window.setTimeout(function(){ window.setTimeout(function(){
try{
var e = document.querySelector( window.location.hash ); var e = document.querySelector( window.location.hash );
if( e && e.scrollIntoView ){ if( e && e.scrollIntoView ){
e.scrollIntoView({ e.scrollIntoView({
block: 'start', block: 'start',
}); });
} }
} catch( e ){}
}, 10); }, 10);
} }