Skip to content

Commit 615a7a5

Browse files
committed
Prevent persisting an Antonym that does not match AntonymId
1 parent 6961cdc commit 615a7a5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/SIL.Harmony.Sample/Changes/AddAntonymReferenceChange.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public override async ValueTask ApplyChange(Word entity, IChangeContext context)
1919
var antonym = await context.GetCurrent<Word>(AntonymId);
2020
if (antonym is null or { DeletedAt: not null }) return;
2121

22-
if (SetObject) entity.Antonym = antonym;
22+
entity.Antonym = SetObject ? antonym : null;
2323
entity.AntonymId = AntonymId;
2424
}
2525
}

0 commit comments

Comments
 (0)