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.
pull/21833/head
Travis Ralston 2019-02-24 17:44:55 -07:00
parent 896a8c1c1d
commit 6cc534e503
1 changed files with 2 additions and 2 deletions

View File

@ -537,12 +537,12 @@ module.exports = React.createClass({
case 'picture_snapshot': case 'picture_snapshot':
this.uploadFile(payload.file); this.uploadFile(payload.file);
break; break;
case 'notifier_enabled':
case 'upload_failed': case 'upload_failed':
// 413: File was too big or upset the server in some way. // 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); this._fetchMediaConfig(true);
} }
case 'notifier_enabled':
case 'upload_started': case 'upload_started':
case 'upload_finished': case 'upload_finished':
this.forceUpdate(); this.forceUpdate();