Fix missing accountItem crash bug

This commit is contained in:
Gucheng Wang 2023-02-22 12:16:05 +08:00
parent ace8e9da06
commit 7e0ea0b8d9

View File

@ -211,6 +211,10 @@ func GetAccountItemByName(name string, organization *Organization) *AccountItem
} }
func CheckAccountItemModifyRule(accountItem *AccountItem, user *User, lang string) (bool, string) { func CheckAccountItemModifyRule(accountItem *AccountItem, user *User, lang string) (bool, string) {
if accountItem == nil {
return true, ""
}
switch accountItem.ModifyRule { switch accountItem.ModifyRule {
case "Admin": case "Admin":
if user == nil || !user.IsAdmin && !user.IsGlobalAdmin { if user == nil || !user.IsAdmin && !user.IsGlobalAdmin {