From 1f501dae9e12cf092ec6eb5416620d5287a97074 Mon Sep 17 00:00:00 2001 From: delvh Date: Mon, 6 Nov 2023 03:05:24 +0100 Subject: [PATCH] Fix JS NPE when viewing specific range of PR commits (#27912) This should be the easiest fix. While other solutions might be possible that exterminate the root cause, they will not be as trivial. --- 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(); } },