aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwxiaoguang2022-06-17 17:44:35 +0800
committerGitHub2022-06-17 17:44:35 +0800
commit719eb4a879be759c2853b50f3f30da78e2a66c82 (patch)
tree3ab4611cf849dffc1241ab54a55a3594b17fbb61
parenta036507204fabd1d7cff3577692bc7d8e4ef7395 (diff)
Fix a JS error in initRepoCommitLastCommitLoader's entryMap (#19996)
-rw-r--r--web_src/js/features/repo-commit.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/web_src/js/features/repo-commit.js b/web_src/js/features/repo-commit.js
index a911c1739..94fca7a9c 100644
--- a/web_src/js/features/repo-commit.js
+++ b/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);
+ }
});
});
}