Skip to content

Commit 413c6e9

Browse files
committed
more exception handling
1 parent b8fd312 commit 413c6e9

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

FlashpointSecurePlayer/FlashpointSecurePlayer.cs

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -488,9 +488,13 @@ private async Task StopSecurePlayback(FormClosingEventArgs e) {
488488
// only if closing...
489489
ShowOutput(Properties.Resources.RequiredComponentsAreUnloading);
490490

491-
await DeactivateModificationsAsync(delegate (string text) {
492-
// I will assassinate the Cyrollan delegate myself...
493-
}).ConfigureAwait(false);
491+
try {
492+
await DeactivateModificationsAsync(delegate (string text) {
493+
// I will assassinate the Cyrollan delegate myself...
494+
}).ConfigureAwait(false);
495+
} catch (InvalidModificationException) {
496+
// Fail silently.
497+
}
494498
}
495499

496500
private async void FlashpointSecurePlayer_Load(object sender, EventArgs e) {
@@ -649,7 +653,13 @@ private async void FlashpointSecurePlayer_FormClosing(object sender, FormClosing
649653
// do stuff, but not if restarting
650654
// not too important for this to work, we can reset it on restart
651655
if (!e.Cancel) {
652-
await StopSecurePlayback(e).ConfigureAwait(false);
656+
try {
657+
await StopSecurePlayback(e).ConfigureAwait(false);
658+
} catch (InvalidModificationException) {
659+
// Fail silently.
660+
} catch (InvalidCurationException) {
661+
// Fail silently.
662+
}
653663
}
654664
}
655665
}

0 commit comments

Comments
 (0)