same patch for dns being nil

This commit is contained in:
Miek Gieben 2010-10-07 08:46:46 +02:00
parent 13e6e74680
commit 3c745019dd
1 changed files with 3 additions and 0 deletions

View File

@ -619,6 +619,9 @@ func (dns *Msg) Unpack(msg []byte) bool {
}
func (dns *Msg) String() string {
if dns == nil {
return "<nil> MsgHdr"
}
s := dns.MsgHdr.String() + " "
s += "QUERY: " + strconv.Itoa(len(dns.Question)) + ", "
s += "ANSWER: " + strconv.Itoa(len(dns.Answer)) + ", "