mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-23 02:36:42 +00:00
nil slices to empty
This commit is contained in:
@@ -949,6 +949,8 @@ func (s *SqlStore) GetAccount(ctx context.Context, accountID string) (*types.Acc
|
|||||||
}
|
}
|
||||||
if autoGroups != nil {
|
if autoGroups != nil {
|
||||||
_ = json.Unmarshal(autoGroups, &sk.AutoGroups)
|
_ = json.Unmarshal(autoGroups, &sk.AutoGroups)
|
||||||
|
} else {
|
||||||
|
sk.AutoGroups = []string{}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return sk, err
|
return sk, err
|
||||||
@@ -1077,6 +1079,8 @@ func (s *SqlStore) GetAccount(ctx context.Context, accountID string) (*types.Acc
|
|||||||
}
|
}
|
||||||
if autoGroups != nil {
|
if autoGroups != nil {
|
||||||
_ = json.Unmarshal(autoGroups, &u.AutoGroups)
|
_ = json.Unmarshal(autoGroups, &u.AutoGroups)
|
||||||
|
} else {
|
||||||
|
u.AutoGroups = []string{}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return u, err
|
return u, err
|
||||||
@@ -1112,7 +1116,11 @@ func (s *SqlStore) GetAccount(ctx context.Context, accountID string) (*types.Acc
|
|||||||
}
|
}
|
||||||
if resources != nil {
|
if resources != nil {
|
||||||
_ = json.Unmarshal(resources, &g.Resources)
|
_ = json.Unmarshal(resources, &g.Resources)
|
||||||
|
} else {
|
||||||
|
g.Resources = []types.Resource{}
|
||||||
}
|
}
|
||||||
|
g.GroupPeers = []types.GroupPeer{}
|
||||||
|
g.Peers = []string{}
|
||||||
}
|
}
|
||||||
return &g, err
|
return &g, err
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -867,6 +867,8 @@ func (s *SqlStore) GetAccountPureSQL(ctx context.Context, accountID string) (*ty
|
|||||||
}
|
}
|
||||||
if autoGroups != nil {
|
if autoGroups != nil {
|
||||||
_ = json.Unmarshal(autoGroups, &sk.AutoGroups)
|
_ = json.Unmarshal(autoGroups, &sk.AutoGroups)
|
||||||
|
} else {
|
||||||
|
sk.AutoGroups = []string{}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return sk, err
|
return sk, err
|
||||||
@@ -995,6 +997,8 @@ func (s *SqlStore) GetAccountPureSQL(ctx context.Context, accountID string) (*ty
|
|||||||
}
|
}
|
||||||
if autoGroups != nil {
|
if autoGroups != nil {
|
||||||
_ = json.Unmarshal(autoGroups, &u.AutoGroups)
|
_ = json.Unmarshal(autoGroups, &u.AutoGroups)
|
||||||
|
} else {
|
||||||
|
u.AutoGroups = []string{}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return u, err
|
return u, err
|
||||||
@@ -1030,7 +1034,11 @@ func (s *SqlStore) GetAccountPureSQL(ctx context.Context, accountID string) (*ty
|
|||||||
}
|
}
|
||||||
if resources != nil {
|
if resources != nil {
|
||||||
_ = json.Unmarshal(resources, &g.Resources)
|
_ = json.Unmarshal(resources, &g.Resources)
|
||||||
|
} else {
|
||||||
|
g.Resources = []types.Resource{}
|
||||||
}
|
}
|
||||||
|
g.GroupPeers = []types.GroupPeer{}
|
||||||
|
g.Peers = []string{}
|
||||||
}
|
}
|
||||||
return &g, err
|
return &g, err
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user