From 999775374de7ece47a28562431fb8cc12307a0b6 Mon Sep 17 00:00:00 2001 From: garmr Date: Tue, 27 Feb 2024 13:21:46 -0800 Subject: [PATCH] fixed another wrapped nil error return --- actions/actions.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/actions/actions.go b/actions/actions.go index cbed82a..3383e3e 100644 --- a/actions/actions.go +++ b/actions/actions.go @@ -50,7 +50,11 @@ func (at *ActionTree) Matches(packet gopacket.Packet) (bool, error) { // packets. func (at *ActionTree) Apply(packet gopacket.Packet) ([]gopacket.Packet, error) { r, err := at.RootAction.Apply(packet) - return r, fmt.Errorf("apply failed: %w", err) + if err != nil { + return r, fmt.Errorf("apply failed: %w", err) + } + + return r, nil } // ParseActionTree attempts to parse an action tree from its input.