diff --git a/rhodecode/templates/changeset/changeset.html b/rhodecode/templates/changeset/changeset.html --- a/rhodecode/templates/changeset/changeset.html +++ b/rhodecode/templates/changeset/changeset.html @@ -375,7 +375,9 @@ if (location.hash) { var result = splitDelimitedHash(location.hash); var line = $('html').find(result.loc); - offsetScroll(line, 70); + if (line.length > 0){ + offsetScroll(line, 70); + } } // browse tree @ revision diff --git a/rhodecode/templates/files/files.html b/rhodecode/templates/files/files.html --- a/rhodecode/templates/files/files.html +++ b/rhodecode/templates/files/files.html @@ -177,7 +177,9 @@ var _first_line = $('#L' + h_lines[0]).get(0); if (_first_line) { var line = $('#L' + h_lines[0]); - offsetScroll(line, 70); + if (line.length > 0){ + offsetScroll(line, 70); + } } } } diff --git a/rhodecode/templates/pullrequests/pullrequest_show.html b/rhodecode/templates/pullrequests/pullrequest_show.html --- a/rhodecode/templates/pullrequests/pullrequest_show.html +++ b/rhodecode/templates/pullrequests/pullrequest_show.html @@ -415,7 +415,9 @@ if (location.hash) { var result = splitDelimitedHash(location.hash); var line = $('html').find(result.loc); - offsetScroll(line, 70); + if (line.length > 0){ + offsetScroll(line, 70); + } } $(function(){ ReviewerAutoComplete('user');