From: Jo-Philipp Wich Date: Mon, 13 Jun 2022 13:48:35 +0000 (+0200) Subject: fw4: fix crash in parse_cthelper() if no helpers are present X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=53886e559b9765c61db646fffb2953ab12aac1e7;p=project%2Ffirewall4.git 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 --- 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; },