From 2f40726f556b5edf5d0302a293a528943b9a214b Mon Sep 17 00:00:00 2001 From: fiaxh Date: Thu, 28 May 2020 20:33:28 +0200 Subject: Fix runtime critical --- main/src/ui/contact_details/permissions_provider.vala | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'main/src/ui/contact_details') diff --git a/main/src/ui/contact_details/permissions_provider.vala b/main/src/ui/contact_details/permissions_provider.vala index 1a8649a8..1fd460ad 100644 --- a/main/src/ui/contact_details/permissions_provider.vala +++ b/main/src/ui/contact_details/permissions_provider.vala @@ -17,12 +17,13 @@ public class PermissionsProvider : Plugins.ContactDetailsProvider, Object { if (type != Plugins.WidgetType.GTK) return; Xmpp.Jid? own_jid = stream_interactor.get_module(MucManager.IDENTITY).get_own_jid(conversation.counterpart, conversation.account); - if (stream_interactor.get_module(MucManager.IDENTITY).get_role(own_jid, conversation.account)==Xmpp.Xep.Muc.Role.VISITOR){ - Button voice_request = new Button() {visible=true, label=_("Request")}; - voice_request.clicked.connect(()=>stream_interactor.get_module(MucManager.IDENTITY).request_voice(conversation.account, conversation.counterpart)); - contact_details.add(_("Permissions"), _("Request permission to send messages"), "", voice_request); + if (own_jid == null) return; - } + if (stream_interactor.get_module(MucManager.IDENTITY).get_role(own_jid, conversation.account) == Xmpp.Xep.Muc.Role.VISITOR){ + Button voice_request = new Button() {visible=true, label=_("Request")}; + voice_request.clicked.connect(()=>stream_interactor.get_module(MucManager.IDENTITY).request_voice(conversation.account, conversation.counterpart)); + contact_details.add(_("Permissions"), _("Request permission to send messages"), "", voice_request); + } } } -- cgit v1.2.3-70-g09d2