From a15ba588a81e3abc5179dc07364c174f4a9986cf Mon Sep 17 00:00:00 2001 From: dkkb Date: Sat, 6 Jul 2024 21:19:57 +0800 Subject: [PATCH] fix: Resolve the potential panic error in the Go version example in implementing-deduplication.mdx. --- .../deduplication/implementing-deduplication.mdx | 2 +- .../deduplication/implementing-deduplication.mdx | 2 +- .../deduplication/implementing-deduplication.mdx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/v2/thirdparty/common-customizations/deduplication/implementing-deduplication.mdx b/v2/thirdparty/common-customizations/deduplication/implementing-deduplication.mdx index 72cb13ba9..eff7bb1ad 100644 --- a/v2/thirdparty/common-customizations/deduplication/implementing-deduplication.mdx +++ b/v2/thirdparty/common-customizations/deduplication/implementing-deduplication.mdx @@ -129,7 +129,7 @@ func main() { resp, err := originalSignInUpPOST(provider, input, tenantId, options, userContext) - if err.Error() == "Cannot sign up as email already exists" { + if err != nil && err.Error() == "Cannot sign up as email already exists" { // this error was thrown from our function override above. // so we send a useful message to the user return tpmodels.SignInUpPOSTResponse{ diff --git a/v2/thirdpartyemailpassword/common-customizations/deduplication/implementing-deduplication.mdx b/v2/thirdpartyemailpassword/common-customizations/deduplication/implementing-deduplication.mdx index af2d78142..edf18a975 100644 --- a/v2/thirdpartyemailpassword/common-customizations/deduplication/implementing-deduplication.mdx +++ b/v2/thirdpartyemailpassword/common-customizations/deduplication/implementing-deduplication.mdx @@ -193,7 +193,7 @@ func main() { resp, err := originalSignInUpPOST(provider, input, tenantId, options, userContext) - if err.Error() == "Cannot sign up as email already exists" { + if err != nil && err.Error() == "Cannot sign up as email already exists" { // this error was thrown from our function override above. // so we send a useful message to the user return tpmodels.SignInUpPOSTResponse{ diff --git a/v2/thirdpartypasswordless/common-customizations/deduplication/implementing-deduplication.mdx b/v2/thirdpartypasswordless/common-customizations/deduplication/implementing-deduplication.mdx index 7d5e2fa96..c718ba43b 100644 --- a/v2/thirdpartypasswordless/common-customizations/deduplication/implementing-deduplication.mdx +++ b/v2/thirdpartypasswordless/common-customizations/deduplication/implementing-deduplication.mdx @@ -205,7 +205,7 @@ func main() { resp, err := originalSignInUpPOST(provider, input, tenantId, options, userContext) - if err.Error() == "Cannot sign up as email already exists" { + if err != nil && err.Error() == "Cannot sign up as email already exists" { // this error was thrown from our function override above. // so we send a useful message to the user return tpmodels.SignInUpPOSTResponse{