Skip to content

Commit 5775c22

Browse files
authored
Merge pull request #4020 from norio-nomura/vz-stopUsernet-may-nil
vz: Before calling `stopUsernet`, ensure it’s not `nil`.
2 parents ead2a7b + 56443f8 commit 5775c22

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)