fw4: prevent null access when no ipsets are defined
authorJo-Philipp Wich <jo@mein.io>
Tue, 29 Nov 2022 10:44:15 +0000 (11:44 +0100)
committerJo-Philipp Wich <jo@mein.io>
Tue, 29 Nov 2022 10:48:30 +0000 (11:48 +0100)
commit700a925fd9c1f1ff404e6b125cd5347ad7c45668
tree32662525a790ad8db13c7c01072246be0af194b5
parent6443ec7805295de07f6051662065a16b4a194f19
fw4: prevent null access when no ipsets are defined

When rules are configured which reference ipsets and no ipsets are declared
at all, fw4 crashed with a null reference exception while validating the
rule.

Solve the issue by using the optional chaining operator on the potentially
null filter result.

Ref: https://forum.openwrt.org/t/x/144176
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
root/usr/share/ucode/fw4.uc