1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-11-11 20:22:36 +03:00

Avoid calling with undefined

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner
2021-08-03 15:13:40 +02:00
parent e787d14cde
commit 75948587e4

View File

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