proc/native/windows: when there is an error during Attach dbp might be nil

This commit is contained in:
aarzilli 2018-03-31 19:06:28 +02:00 committed by Derek Parker
parent edf4cebe25
commit 2497caea4a

@ -163,7 +163,9 @@ func Attach(pid int) (*Process, error) {
}
dbp, err := newDebugProcess(New(pid), exepath)
if err != nil {
dbp.Detach(false)
if dbp != nil {
dbp.Detach(false)
}
return nil, err
}
return dbp, nil