mirror of
https://github.com/swissmakers/wireguard-manager.git
synced 2026-04-11 13:47:05 +02:00
better error-handling if no public IP could be detected (#323)
This commit is contained in:
@@ -220,10 +220,12 @@ func GetPublicIP() (model.Interface, error) {
|
||||
ip, err := consensus.ExternalIP()
|
||||
if err != nil {
|
||||
publicInterface.IPAddress = "N/A"
|
||||
} else {
|
||||
publicInterface.IPAddress = ip.String()
|
||||
}
|
||||
publicInterface.IPAddress = ip.String()
|
||||
|
||||
return publicInterface, err
|
||||
// error handling happend above, no need to pass it through
|
||||
return publicInterface, nil
|
||||
}
|
||||
|
||||
// GetIPFromCIDR get ip from CIDR
|
||||
|
||||
Reference in New Issue
Block a user