mirror of
https://github.com/ngoduykhanh/wireguard-ui.git
synced 2025-05-23 00:15:19 +03:00
better error-handling if no public IP could be detected (#323)
This commit is contained in:
parent
814093cdd3
commit
abef29bf17
2 changed files with 7 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue