Browse Source

Fix a JS error in initRepoCommitLastCommitLoader's entryMap (#19996)

pull/19998/head
wxiaoguang 2 weeks ago committed by GitHub
parent
commit
719eb4a879
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      web_src/js/features/repo-commit.js

7
web_src/js/features/repo-commit.js

@ -45,7 +45,12 @@ export function initRepoCommitLastCommitLoader() {
$('table#repo-files-table .commit-list').replaceWith(row);
return;
}
entryMap[$(row).attr('data-entryname')].replaceWith(row);
// there are other <tr> rows in response (eg: <tr class="has-parent">)
// at the moment only the "data-entryname" rows should be processed
const entryName = $(row).attr('data-entryname');
if (entryName) {
entryMap[entryName].replaceWith(row);
}
});
});
}

Loading…
Cancel
Save