Check if the method is defined before calling it

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
pull/21833/head
Šimon Brandner 2021-02-12 16:48:46 +01:00
parent 2b4859a858
commit 97f5b6920c
No known key found for this signature in database
GPG Key ID: 9760693FDD98A790
1 changed files with 3 additions and 1 deletions

View File

@ -538,7 +538,9 @@ export default class SendMessageComposer extends React.Component {
}
onChange = () => {
this.props.onIsEmptyChanged(this.model.isEmpty);
if (this.props.onIsEmptyChanged) {
this.props.onIsEmptyChanged(this.model.isEmpty);
}
}
render() {