Skip to content

Commit

Permalink
fix returning wrapped nil error
Browse files Browse the repository at this point in the history
  • Loading branch information
garmr-ulfr committed Feb 27, 2024
1 parent 9ffe6f3 commit c40e5d7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion actions/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ func (at *ActionTree) String() string {
// Matches returns whether this action tree's trigger matches the packet.
func (at *ActionTree) Matches(packet gopacket.Packet) (bool, error) {
r, err := at.Trigger.Matches(packet)
return r, fmt.Errorf("match failed: %w", err)
if err != nil {
return r, fmt.Errorf("match failed: %w", err)
}

return r, nil
}

// Apply applies this action tree to the packet, returning zero or more potentially-modified
Expand Down

0 comments on commit c40e5d7

Please sign in to comment.