Skip to content

Commit 6af9878

Browse files
authored
ensure FeatureFlags is truly never null (#1660)
1 parent 36e8e65 commit 6af9878

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

backend/LexCore/Entities/User.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@ public void UpdateCreateProjectsPermission(ProjectRole role)
4444
public List<OrgMember> Organizations { get; set; } = [];
4545
public List<FeatureFlag> FeatureFlags
4646
{
47-
get;
4847
//even though this may not be null EF still sets it to null based on what's in the db.
48+
//also, EF may set the underlying field to null directly, bypassing the setter, so we need to do this.
49+
get => field ??= [];
4950
set => field = value ?? [];
5051
} = [];
5152

0 commit comments

Comments
 (0)