Skip to content

Commit

Permalink
Add missing nil check
Browse files Browse the repository at this point in the history
Spotted by @johanix
  • Loading branch information
eest committed May 27, 2024
1 parent f770d87 commit e78c1cc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion dnshandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,10 @@ func QueryResponder(w dns.ResponseWriter, r *dns.Msg, zd *tapir.ZoneData, qname
m.Ns = append(m.Ns, apex.RRtypes[dns.TypeSOA].RRs...)
}
err := w.WriteMsg(m)
return fmt.Errorf("QueryResponder: unable to WriteMsg() in qtype switch: %w", err)
if err != nil {
return fmt.Errorf("QueryResponder: unable to WriteMsg() in qtype switch: %w", err)
}
return nil

default:
// everything we don't want to deal with
Expand Down

0 comments on commit e78c1cc

Please sign in to comment.