Merge pull request #4186 from matrix-org/jryans/mjolnir-stop
Make Mjolnir stop more robustpull/21833/head
commit
d2cd64d9d3
|
@ -65,14 +65,14 @@ export class Mjolnir {
|
||||||
}
|
}
|
||||||
|
|
||||||
stop() {
|
stop() {
|
||||||
SettingsStore.unwatchSetting(this._mjolnirWatchRef);
|
if (this._mjolnirWatchRef) {
|
||||||
|
SettingsStore.unwatchSetting(this._mjolnirWatchRef);
|
||||||
|
this._mjolnirWatchRef = null;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
if (this._dispatcherRef) {
|
||||||
if (this._dispatcherRef) dis.unregister(this._dispatcherRef);
|
dis.unregister(this._dispatcherRef);
|
||||||
} catch (e) {
|
this._dispatcherRef = null;
|
||||||
console.error(e);
|
|
||||||
// Only the tests cause problems with this particular block of code. We should
|
|
||||||
// never be here in production.
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!MatrixClientPeg.get()) return;
|
if (!MatrixClientPeg.get()) return;
|
||||||
|
|
Loading…
Reference in New Issue