mirror of https://github.com/vector-im/riot-web
Avoid calling with undefined
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>pull/21833/head
parent
e787d14cde
commit
75948587e4
|
@ -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 });
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue