[MM-28973] Prevent destructuring of undefined (#4832) (#4838)

* Prevent destructuring of undefined

* Do the same for thread drafts

(cherry picked from commit 8a5c58b39a)

Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>
This commit is contained in:
Mattermost Build 2020-09-24 14:00:58 -04:00 committed by GitHub
parent ae93498d50
commit 8cfa485f51
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -62,7 +62,7 @@ function handleSetTempUploadFileForPostDraft(state, action) {
const tempFiles = action.clientIds.map((temp) => ({...temp, loading: true}));
const files = [
...state[action.channelId].files,
...state[action.channelId]?.files || [],
...tempFiles,
];

View file

@ -73,7 +73,7 @@ function handleSetTempUploadFilesForPostDraft(state, action) {
const tempFiles = action.clientIds.map((temp) => ({...temp, loading: true}));
const files = [
...state[action.rootId].files,
...state[action.rootId]?.files || [],
...tempFiles,
];