Skip to content
This repository has been archived by the owner on Jan 18, 2022. It is now read-only.

Commit

Permalink
ensure that requireable fields are set to null when the subscription …
Browse files Browse the repository at this point in the history
…is no longer satisfied
  • Loading branch information
Jamie Brynes committed Feb 19, 2020
1 parent ac1c8c2 commit ac4b5d8
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ private void HandleSubscriptionsSatisfied()
private void HandleSubscriptionsNoLongerSatisfied()
{
onDisable?.Invoke();

foreach (var field in info.RequiredFields)
{
if (!field.FieldType.IsValueType)
{
field.SetValue(target, value: null);
}
}
}

private class Handler : ISubscriptionAvailabilityHandler
Expand Down

0 comments on commit ac4b5d8

Please sign in to comment.