summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Zallmann <tzallmann@gitlab.com>2017-10-03 13:56:01 +0200
committerTim Zallmann <tzallmann@gitlab.com>2017-10-04 17:27:56 +0200
commit5c07687b3eedfc4200c9b3fcdffbc79026c285db (patch)
treebd002b15ecf1904d0842534d806b9e7b8db42758
parenta0d238066eb7d88a1ad136dab7c56fc63993b7d2 (diff)
downloadgitlab-ce-5c07687b3eedfc4200c9b3fcdffbc79026c285db.tar.gz
Added Check for Line Number Element
-rw-r--r--app/assets/javascripts/repo/components/repo_sidebar.vue2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/assets/javascripts/repo/components/repo_sidebar.vue b/app/assets/javascripts/repo/components/repo_sidebar.vue
index 9d3e20a195b..0e6acf96836 100644
--- a/app/assets/javascripts/repo/components/repo_sidebar.vue
+++ b/app/assets/javascripts/repo/components/repo_sidebar.vue
@@ -43,7 +43,7 @@ export default {
if (!isNaN(lineNumber)) {
Store.setActiveLine(lineNumber);
if (Store.isPreviewView()) {
- document.getElementById(`L${lineNumber}`).scrollIntoView();
+ if (document.getElementById(`L${lineNumber}`)) document.getElementById(`L${lineNumber}`).scrollIntoView();
} else {
Helper.monacoInstance.setPosition({
lineNumber: this.activeLine,