From f9d949b6188c25d19a932ce3bcb791ca2d671940 Mon Sep 17 00:00:00 2001 From: Julen Landa Alustiza Date: Jul 15 2019 08:56:38 +0000 Subject: templates/repo_pull_request: missing sanity check --- diff --git a/pagure/templates/repo_pull_request.html b/pagure/templates/repo_pull_request.html index e3edf05..f6529ce 100644 --- a/pagure/templates/repo_pull_request.html +++ b/pagure/templates/repo_pull_request.html @@ -1354,9 +1354,12 @@ function updateHighlight(onload) { } } var file = parseInt(location.hash.substr(2).split('__')[0], 10); - var lines = location.hash.split('__')[1].split('-').map(function (x) { return parseInt(x, 10) }); - for (var i = lines[lines.length - 1]; i >= lines[0]; i--) { - $('#' + '_' + file + '__' + i).closest('tr').addClass(cls); + if (file) + { + var lines = location.hash.split('__')[1].split('-').map(function (x) { return parseInt(x, 10) }); + for (var i = lines[lines.length - 1]; i >= lines[0]; i--) { + $('#' + '_' + file + '__' + i).closest('tr').addClass(cls); + } } } } @@ -1408,7 +1411,7 @@ $(document).ready(function () { set_up_subcribed(); {% endif %} - updateHighlight(true) + updateHighlight(true); {% if form or pull_request %} $( "#preview" ).hide(); $( "#previewinmarkdown" ).click(