From efc98098b42e2ba2474cba015eabc7272378e6a8 Mon Sep 17 00:00:00 2001 From: Kenneth Shaw Date: Wed, 22 Feb 2017 15:27:38 +0700 Subject: [PATCH] Fixing panic on Pool.Release --- pool.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pool.go b/pool.go index 18eed24..5a0dc63 100644 --- a/pool.go +++ b/pool.go @@ -145,7 +145,10 @@ type Res struct { func (r *Res) Release() error { 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)