diff --git a/New_College.Api/Controllers/OAuthController.cs b/New_College.Api/Controllers/OAuthController.cs index bd9a5e2..c1fa122 100644 --- a/New_College.Api/Controllers/OAuthController.cs +++ b/New_College.Api/Controllers/OAuthController.cs @@ -52,7 +52,7 @@ namespace New_College.Controllers client_secret = CasdoorConfig.ClientSecret }), Encoding.UTF8, "application/json"));// - if (userinfo.code == 200 && userinfo.type == "success") + if (userinfo != null && userinfo.code == 200 && userinfo.type == "success") { var user = (await _CustomerInfoServices.Query(q => q.UUID == userinfo.result.UnionId)).FirstOrDefault(); if (user != null)