Don't crash when printing name of nil interface
This commit is contained in:
1 parent
ad44a8816f
commit
5f3080b9db
1 file changed
+5
-1
+5
-1
@@ -88,7 +88,11 @@ func StartServer(zone Zone, iface *net.Interface, dnsPort int, httpPort int, wai
|
||||
mdnsClient, err := NewMDNSClient()
|
||||
checkFatal(err)
|
||||
|
||||
Info.Printf("Using mDNS on %s", iface.Name)
|
||||
ifaceName := "default interface"
|
||||
if iface != nil {
|
||||
ifaceName = iface.Name
|
||||
}
|
||||
Info.Printf("Using mDNS on %s", ifaceName)
|
||||
err = mdnsClient.Start(iface)
|
||||
checkFatal(err)
|
||||
|
||||
|
||||
Reference in new issue
Block a user