From bdf8fd492a59a69694ce88ccfd7adb662d540eb3 Mon Sep 17 00:00:00 2001 From: boyce Date: Wed, 2 Sep 2020 20:23:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=85=88=E5=AE=9A=E6=97=B6=E5=99=A8?= =?UTF-8?q?=E9=87=8A=E6=94=BE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- util/timer/timer.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/util/timer/timer.go b/util/timer/timer.go index 34eb944..d9fdcfd 100644 --- a/util/timer/timer.go +++ b/util/timer/timer.go @@ -72,6 +72,9 @@ func (disp *Dispatcher) AfterFuncEx(funName string,d time.Duration, cbex func(ti t.name = funName//reflect.TypeOf(cbex).Name() //t.name = runtime.FuncForPC(reflect.ValueOf(cbex).Pointer()).Name() t.t = time.AfterFunc(d, func() { + if disp == nil { + return + } disp.ChanTimer <- t }) return t