fix the nil pointer panic on closing a disabled network manager
Issue #2768
This commit is contained in:
parent
60cb5f1a34
commit
ef14aaf627
1 changed files with 3 additions and 0 deletions
|
@ -661,6 +661,9 @@ func (manager *NetworkManager) Allocate() (*NetworkInterface, error) {
|
|||
}
|
||||
|
||||
func (manager *NetworkManager) Close() error {
|
||||
if manager.disabled {
|
||||
return nil
|
||||
}
|
||||
err1 := manager.tcpPortAllocator.Close()
|
||||
err2 := manager.udpPortAllocator.Close()
|
||||
err3 := manager.ipAllocator.Close()
|
||||
|
|
Loading…
Reference in a new issue