Skip to content

Commit 56443f8

Browse files
committed
vz: Before calling stopUsernet, ensure it’s not nil.
Fix crashing on using external usernet. Signed-off-by: Norio Nomura <norio.nomura@gmail.com>
1 parent dc24403 commit 56443f8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pkg/driver/vz/vm_darwin.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,9 @@ func startVM(ctx context.Context, inst *limatype.Instance, sshLocalPort int) (*v
118118
wrapper.stopped = true
119119
wrapper.mu.Unlock()
120120
_ = usernetClient.UnExposeSSH(inst.SSHLocalPort)
121-
stopUsernet()
121+
if stopUsernet != nil {
122+
stopUsernet()
123+
}
122124
errCh <- errors.New("vz driver state stopped")
123125
default:
124126
logrus.Debugf("[VZ] - vm state change: %q", newState)

0 commit comments

Comments
 (0)