From 4597dcd2214c565bc6125524e0d5689ecaaad410 Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 10 Jun 2019 15:27:59 +0100 Subject: [PATCH] Fix exception on logout Don't try to unregister if we never registered --- src/components/structures/EmbeddedPage.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/structures/EmbeddedPage.js b/src/components/structures/EmbeddedPage.js index e3c197e1db..ecc01a443d 100644 --- a/src/components/structures/EmbeddedPage.js +++ b/src/components/structures/EmbeddedPage.js @@ -46,6 +46,8 @@ export default class EmbeddedPage extends React.PureComponent { constructor(props) { super(props); + this._dispatcherRef = null; + this.state = { page: '', }; @@ -90,7 +92,7 @@ export default class EmbeddedPage extends React.PureComponent { componentWillUnmount() { this._unmounted = true; - dis.unregister(this._dispatcherRef); + if (this._dispatcherRef !== null) dis.unregister(this._dispatcherRef); } onAction = (payload) => {