李昊 4 years ago
parent
commit
908742f127

+ 1 - 1
gx_api/GxPress/Repository/GxPress.Repository.Implement/GroupRepository.cs

@@ -247,7 +247,7 @@ namespace GxPress.Repository.Implement
             var groupUser = await _groupUserRepository.GetAsync(Q.Where(nameof(GroupUser.UserId), request.UserId)
                 .Where(nameof(GroupUser.GroupId), request.GroupId));
             //获取当前用户的权限
-            groupDetailResult.GroupUserRoleId = groupUser.GroupUserRoleId;
+            groupDetailResult.GroupUserRoleId = groupUser != null ? groupUser.GroupUserRoleId : 0;
             groupDetailResult.IsUDisturb = groupUser.IsUDisturb;
             return groupDetailResult;
         }