Skip to content

Commit 6e14773

Browse files
authored
Fix bogus http requests on diffs (#13760) (#13761)
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 25421f0 commit 6e14773

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
@@ -2089,6 +2089,7 @@ function initCodeView() {
20892089
});
20902090
$(document).on('click', '.blob-excerpt', async ({currentTarget}) => {
20912091
const {url, query, anchor} = currentTarget.dataset;
2092+
if (!url) return;
20922093
const blob = await $.get(`${url}?${query}&anchor=${anchor}`);
20932094
currentTarget.closest('tr').outerHTML = blob;
20942095
});

0 commit comments

Comments
 (0)