From ce7a0fd64c609c9205c0532c31743a7f99906653 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Fri, 30 Oct 2020 17:43:06 +0800 Subject: [PATCH] 1 --- httpserver.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/httpserver.go b/httpserver.go index db3d987..1a7b7a6 100644 --- a/httpserver.go +++ b/httpserver.go @@ -77,8 +77,11 @@ func (this *HttpServer) dispatchRequest(w http.ResponseWriter, r *http.Request) func (this *HttpServer) getHandle(handleName string) (func(*http.ResponseWriter, *http.Request)) { this.handlersMutex.Lock() defer this.handlersMutex.Unlock() - handle, _ := this.handlers[handleName] - return handle + if handle, ok := this.handlers[handleName]; ok { + return handle + } else { + return nil + } } func (this *HttpServer) RegisterHandle(c string, a string,