[FIX] BackHandler remove random failing on development (#1423)

This commit is contained in:
Diego Mello 2019-11-27 17:53:46 -03:00 committed by GitHub
parent 4bb0bfa7eb
commit 3d82cce004
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -208,7 +208,9 @@ class RoomsListView extends React.Component {
});
this.willBlurListener = navigation.addListener('willBlur', () => {
closeServerDropdown();
this.backHandler.remove();
if (this.backHandler && this.backHandler.remove) {
this.backHandler.remove();
}
});
console.timeEnd(`${ this.constructor.name } mount`);
}