diff options
author | Wolfy-J <[email protected]> | 2018-06-13 13:02:38 +0300 |
---|---|---|
committer | Wolfy-J <[email protected]> | 2018-06-13 13:02:38 +0300 |
commit | d2c7ee8c0a070b9790d5552d3f607ca01e1ab798 (patch) | |
tree | 14a53d4de55b71a5bd376ddb3ad0edbd0f7f1546 /service/http/handler.go | |
parent | 9786e79d05beede8c8d21d9281623ff8b2388b08 (diff) |
tests!
Diffstat (limited to 'service/http/handler.go')
-rw-r--r-- | service/http/handler.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/service/http/handler.go b/service/http/handler.go index 8c604127..2d749207 100644 --- a/service/http/handler.go +++ b/service/http/handler.go @@ -113,10 +113,9 @@ func (h *Handler) handleError(w http.ResponseWriter, r *http.Request, err error) // throw invokes event srv if any. func (h *Handler) throw(event int, ctx interface{}) { h.mul.Lock() - lsn := h.lsn - h.mul.Unlock() + defer h.mul.Unlock() - if lsn != nil { - lsn(event, ctx) + if h.lsn != nil { + h.lsn(event, ctx) } } |