From 49f82ac4e37e34f1544138a523ce25125ae56453 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Mon, 6 Nov 2023 17:22:44 +0800 Subject: [PATCH] Fix JS NPE when viewing specific range of PR commits (#27912) (#27923) Backport #27912 by @delvh This should be the easiest fix. While other solutions might be possible that exterminate the root cause, they will not be as trivial. Co-authored-by: delvh --- web_src/js/components/DiffCommitSelector.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web_src/js/components/DiffCommitSelector.vue b/web_src/js/components/DiffCommitSelector.vue index 3f7100d201..439840c306 100644 --- a/web_src/js/components/DiffCommitSelector.vue +++ b/web_src/js/components/DiffCommitSelector.vue @@ -94,7 +94,7 @@ export default { focusElem(elem, prevElem) { if (elem) { elem.tabIndex = 0; - prevElem.tabIndex = -1; + if (prevElem) prevElem.tabIndex = -1; elem.focus(); } },