refactored delete, pull nil pointer and logging

This commit is contained in:
0xdcarns
2022-02-08 10:43:46 -05:00
parent a85a888251
commit 39cea2da6c
8 changed files with 57 additions and 27 deletions

View File

@@ -219,6 +219,7 @@ func LeaveNetwork(network string) error {
currentNets, err := ncutils.GetSystemNetworks()
if err != nil || len(currentNets) <= 1 {
daemon.Stop() // stop system daemon if last network
return RemoveLocalInstance(cfg, network)
}
return daemon.Restart()