mirror of
https://github.com/AsamK/signal-cli.git
synced 2026-07-26 00:29:23 +00:00
Fix NPE in endCall when deviceId is null
HangupMessage requires a non-null deviceId, but deviceId is only set once the remote peer's offer is received. If the call ends before the offer arrives (e.g. tunnel fails to spawn), deviceId is null and the HangupMessage constructor throws a NullPointerException. Guard the hangup send with a deviceId != null check so the protocol message is only sent when there is a known remote device to address.
This commit is contained in:
parent
6bef205b3f
commit
c9691849be
@ -706,8 +706,11 @@ public class CallManager implements AutoCloseable {
|
||||
fireCallEvent(state, reason);
|
||||
logger.debug("Call {} ended: {}", callIdUnsigned(callId), reason);
|
||||
|
||||
// Send Signal protocol hangup to remote peer (unless they initiated the end)
|
||||
if (!"remote_hangup".equals(reason)
|
||||
// Send Signal protocol hangup to remote peer (unless they initiated the end).
|
||||
// Skip if deviceId is null: no offer was exchanged yet (e.g. tunnel failed to spawn),
|
||||
// so there is no remote device to notify.
|
||||
if (state.deviceId != null
|
||||
&& !"remote_hangup".equals(reason)
|
||||
&& !"rejected".equals(reason)
|
||||
&& !"remote_busy".equals(reason)
|
||||
&& !"ringrtc_hangup".equals(reason)) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user