Avoid calling with undefined

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
pull/21833/head
Šimon Brandner 2021-08-03 15:13:40 +02:00
parent e787d14cde
commit 75948587e4
No known key found for this signature in database
GPG Key ID: CC823428E9B582FB
1 changed files with 4 additions and 2 deletions

View File

@ -64,9 +64,11 @@ export default class IncomingCallBox extends React.Component<IProps, IState> {
switch (payload.action) {
case 'call_state': {
const incomingCall = CallHandler.sharedInstance().getCallForRoom(payload.room_id);
const silenced = CallHandler.sharedInstance().isCallSilenced(incomingCall.callId);
if (incomingCall && incomingCall.state === CallState.Ringing) {
this.setState({ incomingCall, silenced });
this.setState({
incomingCall,
silenced: CallHandler.sharedInstance().isCallSilenced(incomingCall.callId),
});
} else {
this.setState({ incomingCall: null });
}