From f0ed400732d226ee66e257c97bb28d307396cb22 Mon Sep 17 00:00:00 2001 From: Conor Macpherson Date: Tue, 18 Apr 2023 13:47:35 -0400 Subject: [PATCH] remove use of reflection to detect app err. --- server/channels/api4/hosted_customer.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/server/channels/api4/hosted_customer.go b/server/channels/api4/hosted_customer.go index 5a6ceda767b..5affb6c1b12 100644 --- a/server/channels/api4/hosted_customer.go +++ b/server/channels/api4/hosted_customer.go @@ -188,9 +188,8 @@ func selfHostedConfirm(c *Context, w http.ResponseWriter, r *http.Request) { c.Err = model.NewAppError(where, "api.cloud.app_error", nil, "", http.StatusInternalServerError).Wrap(err) return } - license, err := c.App.Srv().Platform().SaveLicense([]byte(confirmResponse.License)) - // dealing with an AppError - if !(reflect.ValueOf(err).Kind() == reflect.Ptr && reflect.ValueOf(err).IsNil()) { + license, appErr := c.App.Srv().Platform().SaveLicense([]byte(confirmResponse.License)) + if appErr != nil { if confirmResponse != nil { c.App.NotifySelfHostedSignupProgress(confirmResponse.Progress, user.Id) }