From 22c1e05e1c386881a8926ff02b9d56e6de8f9bf0 Mon Sep 17 00:00:00 2001 From: Skyxim Date: Thu, 28 Apr 2022 09:44:29 +0800 Subject: [PATCH] fix: rule provider http api crash --- hub/route/provider.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hub/route/provider.go b/hub/route/provider.go index 163ee26a..e8c985a8 100644 --- a/hub/route/provider.go +++ b/hub/route/provider.go @@ -94,8 +94,8 @@ func getRuleProviders(w http.ResponseWriter, r *http.Request) { } func updateRuleProvider(w http.ResponseWriter, r *http.Request) { - provider := r.Context().Value(CtxKeyProvider).(*provider.RuleProvider) - if err := (*provider).Update(); err != nil { + provider := r.Context().Value(CtxKeyProvider).(provider.RuleProvider) + if err := provider.Update(); err != nil { render.Status(r, http.StatusServiceUnavailable) render.JSON(w, r, newError(err.Error())) }