fixed NPE when service isnt bound

This commit is contained in:
Daniel Gultsch 2021-03-13 10:51:41 +01:00
parent bf9d1a5759
commit 7c53dcc4f4

View file

@ -986,7 +986,7 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
menuCall.setVisible(false);
menuOngoingCall.setVisible(false);
} else {
final XmppConnectionService service = activity.xmppConnectionService;
final XmppConnectionService service = activity == null ? null : activity.xmppConnectionService;
final Optional<OngoingRtpSession> ongoingRtpSession = service == null ? Optional.absent() : service.getJingleConnectionManager().getOngoingRtpConnection(conversation.getContact());
if (ongoingRtpSession.isPresent()) {
menuOngoingCall.setVisible(true);