graphql: fix nil deref on a timer (#27978)
graphql: fix the panic of nil timer.Stop Signed-off-by: jsvisa <delweng@gmail.com>
This commit is contained in:
parent
16946d218a
commit
c31f9cf23a
@ -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)
|
response := h.Schema.Exec(ctx, params.Query, params.OperationName, params.Variables)
|
||||||
|
if timer != nil {
|
||||||
timer.Stop()
|
timer.Stop()
|
||||||
|
}
|
||||||
responded.Do(func() {
|
responded.Do(func() {
|
||||||
responseJSON, err := json.Marshal(response)
|
responseJSON, err := json.Marshal(response)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user