fix: catch ipc errors

This commit is contained in:
Anna 2022-07-13 16:35:47 -04:00
parent 44fdbbd360
commit 3e96468084
1 changed files with 13 additions and 2 deletions

View File

@ -24,13 +24,24 @@ internal class ChatTwo : IDisposable {
this.Available = this.Plugin.Interface.GetIpcSubscriber<object?>("ChatTwo.Available");
this.Available.Subscribe(this.DoRegister);
this.DoRegister();
try {
this.DoRegister();
} catch (Exception) {
// try to register if chat 2 is already loaded
// if not, just ignore exception
}
this.Invoke.Subscribe(this.Integration);
}
public void Dispose() {
if (this._id != null) {
this.Unregister.InvokeAction(this._id);
try {
this.Unregister.InvokeAction(this._id);
} catch (Exception) {
// no-op
}
this._id = null;
}