From 53886e559b9765c61db646fffb2953ab12aac1e7 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Mon, 13 Jun 2022 15:48:35 +0200 Subject: [PATCH] fw4: fix crash in parse_cthelper() if no helpers are present Properly deal with a possibly uninitialized helper object array. Signed-off-by: Jo-Philipp Wich --- root/usr/share/ucode/fw4.uc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/root/usr/share/ucode/fw4.uc b/root/usr/share/ucode/fw4.uc index db1e580..95e2540 100644 --- a/root/usr/share/ucode/fw4.uc +++ b/root/usr/share/ucode/fw4.uc @@ -1037,7 +1037,7 @@ return { if (!rv) return null; - let helper = filter(this.state.helpers, h => (h.name == rv.val))[0]; + let helper = filter(this.state.helpers, h => (h.name == rv.val))?.[0]; return helper ? { ...rv, ...helper } : null; }, -- 2.30.2