[FIX] Thread crash if room is undefined (#956)

This commit is contained in:
Diego Mello 2019-06-03 09:53:06 -03:00 committed by GitHub
parent 7c34e66590
commit b28d79e644
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -85,6 +85,12 @@ export default class ThreadMessagesView extends React.Component {
// eslint-disable-next-line react/sort-comp
init = () => {
const [room] = this.rooms;
// if there's not room at this point, it's better to show nothing
if (!room) {
return;
}
const lastThreadSync = new Date();
if (room.lastThreadSync) {
this.sync(room.lastThreadSync);