diff --git a/controllers/admin/chat.go b/controllers/admin/chat.go index 4ce73d618..86d7c8ace 100644 --- a/controllers/admin/chat.go +++ b/controllers/admin/chat.go @@ -97,6 +97,7 @@ func GetIPAddressBans(w http.ResponseWriter, r *http.Request) { bans, err := data.GetIPAddressBans() if err != nil { controllers.WriteSimpleResponse(w, false, err.Error()) + return } controllers.WriteResponse(w, bans) diff --git a/controllers/admin/config.go b/controllers/admin/config.go index 58bd084cd..082f052da 100644 --- a/controllers/admin/config.go +++ b/controllers/admin/config.go @@ -626,6 +626,7 @@ func SetExternalActions(w http.ResponseWriter, r *http.Request) { if err := data.SetExternalActions(actions.Value); err != nil { controllers.WriteSimpleResponse(w, false, "unable to update external actions with provided values") + return } controllers.WriteSimpleResponse(w, true, "external actions update") @@ -662,6 +663,7 @@ func SetForbiddenUsernameList(w http.ResponseWriter, r *http.Request) { if err := data.SetForbiddenUsernameList(request.Value); err != nil { controllers.WriteSimpleResponse(w, false, err.Error()) + return } controllers.WriteSimpleResponse(w, true, "forbidden username list updated") @@ -683,6 +685,7 @@ func SetSuggestedUsernameList(w http.ResponseWriter, r *http.Request) { if err := data.SetSuggestedUsernamesList(request.Value); err != nil { controllers.WriteSimpleResponse(w, false, err.Error()) + return } controllers.WriteSimpleResponse(w, true, "suggested username list updated") diff --git a/controllers/admin/federation.go b/controllers/admin/federation.go index 55032df3c..46844c6e6 100644 --- a/controllers/admin/federation.go +++ b/controllers/admin/federation.go @@ -24,6 +24,7 @@ func SendFederatedMessage(w http.ResponseWriter, r *http.Request) { message, ok := configValue.Value.(string) if !ok { controllers.WriteSimpleResponse(w, false, "unable to send message") + return } if err := activitypub.SendPublicFederatedMessage(message); err != nil {