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,