diff options
-rw-r--r-- | app/assets/javascripts/repo/components/repo_sidebar.vue | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/assets/javascripts/repo/components/repo_sidebar.vue b/app/assets/javascripts/repo/components/repo_sidebar.vue index 0e6acf96836..9f58f63b850 100644 --- a/app/assets/javascripts/repo/components/repo_sidebar.vue +++ b/app/assets/javascripts/repo/components/repo_sidebar.vue @@ -42,8 +42,8 @@ export default { const lineNumber = Number(location.hash.substr(2)); if (!isNaN(lineNumber)) { Store.setActiveLine(lineNumber); - if (Store.isPreviewView()) { - if (document.getElementById(`L${lineNumber}`)) document.getElementById(`L${lineNumber}`).scrollIntoView(); + if (Store.isPreviewView() && document.getElementById(`L${lineNumber}`)) { + document.getElementById(`L${lineNumber}`).scrollIntoView(); } else { Helper.monacoInstance.setPosition({ lineNumber: this.activeLine, |