[FIX] Thread crash if room is undefined (#956)
This commit is contained in:
parent
7c34e66590
commit
b28d79e644
|
@ -85,6 +85,12 @@ export default class ThreadMessagesView extends React.Component {
|
||||||
// eslint-disable-next-line react/sort-comp
|
// eslint-disable-next-line react/sort-comp
|
||||||
init = () => {
|
init = () => {
|
||||||
const [room] = this.rooms;
|
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();
|
const lastThreadSync = new Date();
|
||||||
if (room.lastThreadSync) {
|
if (room.lastThreadSync) {
|
||||||
this.sync(room.lastThreadSync);
|
this.sync(room.lastThreadSync);
|
||||||
|
|
Loading…
Reference in New Issue