From 19a65b065c5ab28f8432fce702dbf94d4a076931 Mon Sep 17 00:00:00 2001 From: Samler Date: Mon, 30 Jun 2025 19:34:18 +0800 Subject: [PATCH] fix: new user group error in without replication (#2596) --- inventory/group.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inventory/group.go b/inventory/group.go index 70089ed..9c8f8fa 100644 --- a/inventory/group.go +++ b/inventory/group.go @@ -85,8 +85,8 @@ func (c *groupClient) Upsert(ctx context.Context, group *ent.Group) (*ent.Group, SetPermissions(group.Permissions). SetSettings(group.Settings) - if group.StoragePolicyID > 0 { - stm.SetStoragePolicyID(group.StoragePolicyID) + if group.Edges.StoragePolicies != nil && group.Edges.StoragePolicies.ID > 0 { + stm.SetStoragePolicyID(group.Edges.StoragePolicies.ID) } return stm.Save(ctx)