Unverified Commit c31f9cf2 authored by Delweng's avatar Delweng Committed by GitHub

graphql: fix nil deref on a timer (#27978)

graphql: fix the panic of nil timer.Stop
Signed-off-by: 's avatarjsvisa <delweng@gmail.com>
parent 16946d21
......@@ -88,7 +88,9 @@ func (h handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
}
response := h.Schema.Exec(ctx, params.Query, params.OperationName, params.Variables)
timer.Stop()
if timer != nil {
timer.Stop()
}
responded.Do(func() {
responseJSON, err := json.Marshal(response)
if err != nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment