From 6cc534e503a9e427b43ce2bedfbadc931e557a95 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Sun, 24 Feb 2019 17:44:55 -0700 Subject: [PATCH] Fix NPE relating to toggling notifications The fallthrough for `notifier_enabled` caused a NPE on `payload.error`, so this moves the fallthrough to where it is intended and sanity checks `payload.error` for next time. --- src/components/structures/RoomView.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/structures/RoomView.js b/src/components/structures/RoomView.js index c93337eb6e..85f3afdfa5 100644 --- a/src/components/structures/RoomView.js +++ b/src/components/structures/RoomView.js @@ -537,12 +537,12 @@ module.exports = React.createClass({ case 'picture_snapshot': this.uploadFile(payload.file); break; - case 'notifier_enabled': case 'upload_failed': // 413: File was too big or upset the server in some way. - if(payload.error.http_status === 413) { + if (payload.error && payload.error.http_status === 413) { this._fetchMediaConfig(true); } + case 'notifier_enabled': case 'upload_started': case 'upload_finished': this.forceUpdate();