fix: catch ipc errors
This commit is contained in:
parent
d16eb7f084
commit
08a3e3a02e
|
@ -24,13 +24,24 @@ internal class ChatTwo : IDisposable {
|
||||||
this.Available = this.Plugin.Interface.GetIpcSubscriber<object?>("ChatTwo.Available");
|
this.Available = this.Plugin.Interface.GetIpcSubscriber<object?>("ChatTwo.Available");
|
||||||
|
|
||||||
this.Available.Subscribe(this.DoRegister);
|
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);
|
this.Invoke.Subscribe(this.Integration);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Dispose() {
|
public void Dispose() {
|
||||||
if (this._id != null) {
|
if (this._id != null) {
|
||||||
this.Unregister.InvokeAction(this._id);
|
try {
|
||||||
|
this.Unregister.InvokeAction(this._id);
|
||||||
|
} catch (Exception) {
|
||||||
|
// no-op
|
||||||
|
}
|
||||||
|
|
||||||
this._id = null;
|
this._id = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user