Skip to content

Commit

Permalink
Call OnChanged on Unset()
Browse files Browse the repository at this point in the history
  • Loading branch information
XDelta committed Oct 25, 2023
1 parent 8209c83 commit c9d8e06
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ResoniteModLoader/ModConfigurationKey.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,18 @@ internal void Set(object? value) {
try {
OnChanged?.SafeInvoke(value);
} catch (Exception e) {
Logger.ErrorInternal($"An OnChanged event subscriber for {this.Name} threw an exception:\n{e}");
Logger.ErrorInternal($"An OnChanged event subscriber for {Name} threw an exception:\n{e}");
}
}

internal bool Unset() {
bool hadValue = HasValue;
HasValue = false;
try {
OnChanged?.SafeInvoke();
} catch (Exception e) {
Logger.ErrorInternal($"An OnChanged event subscriber for {Name} threw an exception:\n{e}");
}
return hadValue;
}
}
Expand Down

0 comments on commit c9d8e06

Please sign in to comment.