Skip to content

Commit

Permalink
Fixed panic with bad dns records
Browse files Browse the repository at this point in the history
  • Loading branch information
Ice3man543 committed Feb 5, 2021
1 parent 82e8b62 commit 1415f43
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions fastdialer/dialer.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package fastdialer

import (
"context"
"errors"
"fmt"
"net"
"strings"
Expand Down Expand Up @@ -124,14 +125,15 @@ func (d *Dialer) GetDNSData(hostname string) (*retryabledns.DNSData, error) {
if err != nil {
return nil, err
}
if data == nil {
return nil, errors.New("could not resolve host")
}
b, _ := data.Marshal()
err = d.hm.Set(hostname, b)
if err != nil {
return nil, err
}

return data, nil
}

return data, nil
}

0 comments on commit 1415f43

Please sign in to comment.