From 304d655bb3966cb91d9f1793137328d128344f06 Mon Sep 17 00:00:00 2001 From: Nick Misasi Date: Fri, 16 Jul 2021 11:05:43 -0400 Subject: [PATCH] Add a return in 2 places (#17942) * Add a return in 2 places * Missed return --- api4/cloud.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/api4/cloud.go b/api4/cloud.go index dbf3237b0c..e5405c16d0 100644 --- a/api4/cloud.go +++ b/api4/cloud.go @@ -91,6 +91,7 @@ func changeSubscription(c *Context, w http.ResponseWriter, r *http.Request) { var subscriptionChange *model.SubscriptionChange if err = json.Unmarshal(bodyBytes, &subscriptionChange); err != nil { c.Err = model.NewAppError("Api4.changeSubscription", "api.cloud.app_error", nil, err.Error(), http.StatusBadRequest) + return } currentSubscription, appErr := c.App.Cloud().GetSubscription(c.AppContext.Session().UserId) @@ -102,11 +103,13 @@ func changeSubscription(c *Context, w http.ResponseWriter, r *http.Request) { changedSub, err := c.App.Cloud().ChangeSubscription(c.AppContext.Session().UserId, currentSubscription.ID, subscriptionChange) if err != nil { c.Err = model.NewAppError("Api4.changeSubscription", "api.cloud.app_error", nil, err.Error(), http.StatusInternalServerError) + return } json, err := json.Marshal(changedSub) if err != nil { c.Err = model.NewAppError("Api4.changeSubscription", "api.cloud.app_error", nil, err.Error(), http.StatusInternalServerError) + return } w.Write(json)