Fixing panic on Pool.Release

This commit is contained in:
Kenneth Shaw 2017-02-22 15:27:38 +07:00
parent a6d06c7524
commit efc98098b4

View File

@ -145,7 +145,10 @@ type Res struct {
func (r *Res) Release() error { func (r *Res) Release() error {
r.cancel() r.cancel()
err := r.c.Wait() var err error
if r.c != nil {
err = r.c.Wait()
}
defer r.p.debugf("pool released %d", r.port) defer r.p.debugf("pool released %d", r.port)