From 25907301a3e4b13db87bc7421a88fd2933de7590 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Tue, 18 Apr 2017 12:53:15 +0100 Subject: [PATCH] More unmounted guards in BugReportDialog --- src/components/views/dialogs/BugReportDialog.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/components/views/dialogs/BugReportDialog.js b/src/components/views/dialogs/BugReportDialog.js index 92b3c4b1b9..7a65ac587f 100644 --- a/src/components/views/dialogs/BugReportDialog.js +++ b/src/components/views/dialogs/BugReportDialog.js @@ -62,13 +62,17 @@ export default class BugReportDialog extends React.Component { sendLogs: sendLogs, progressCallback: this._sendProgressCallback, }).then(() => { - this.setState({ busy: false, progress: null }); - this.props.onFinished(false); + if (!this._unmounted) { + this.setState({ busy: false, progress: null }); + this.props.onFinished(false); + } }, (err) => { - this.setState({ - busy: false, progress: null, - err: `Failed to send report: ${err.message}`, - }); + if (!this._unmounted) { + this.setState({ + busy: false, progress: null, + err: `Failed to send report: ${err.message}`, + }); + } }); }); }