Skip to content

Commit 21cf205

Browse files
authored
Fix bogus http requests on diffs (#13760)
The .blob-excerpt elements don't have these data attributes in some cases resulting in bogus http request when expanding a diff and clicking into the expanded area. This prevents those. Should backport to 1.13. Fixes: #13759
1 parent d7ab726 commit 21cf205

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

web_src/js/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2118,6 +2118,7 @@ function initCodeView() {
21182118
});
21192119
$(document).on('click', '.blob-excerpt', async ({currentTarget}) => {
21202120
const {url, query, anchor} = currentTarget.dataset;
2121+
if (!url) return;
21212122
const blob = await $.get(`${url}?${query}&anchor=${anchor}`);
21222123
currentTarget.closest('tr').outerHTML = blob;
21232124
});

0 commit comments

Comments
 (0)