From 2bfaadce0b46a3ebcd09543e8101c001b09018fa Mon Sep 17 00:00:00 2001 From: csoler Date: Mon, 11 May 2020 19:02:33 +0200 Subject: [PATCH] attempt to fix crash in revoke ids from circle --- retroshare-gui/src/gui/Identity/IdDialog.cpp | 22 +++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/retroshare-gui/src/gui/Identity/IdDialog.cpp b/retroshare-gui/src/gui/Identity/IdDialog.cpp index 929f45f5d..f829cf07f 100644 --- a/retroshare-gui/src/gui/Identity/IdDialog.cpp +++ b/retroshare-gui/src/gui/Identity/IdDialog.cpp @@ -941,14 +941,26 @@ void IdDialog::revokeCircleMembership() if(!getItemCircleId(ui->treeWidget_membership->currentItem(),circle_id)) return; + if(circle_id.isNull()) + { + RsErr() << __PRETTY_FUNCTION__ << " : got a null circle ID. Cannot revoke an identity from that circle!" << std::endl; + return ; + } + RsGxsId gxs_id_to_revoke(qobject_cast(sender())->data().toString().toStdString()); - RsThread::async([circle_id,gxs_id_to_revoke]() - { - // 1 - get message data from p3GxsForums + if(gxs_id_to_revoke.isNull()) + RsErr() << __PRETTY_FUNCTION__ << " : got a null ID. Cannot revoke it from circle " << circle_id << "!" << std::endl; + else + RsThread::async([circle_id,gxs_id_to_revoke]() + { + // 1 - get message data from p3GxsForums - rsGxsCircles->revokeIdsFromCircle(std::set( { gxs_id_to_revoke } ),circle_id); - }); + std::set ids; + ids.insert(gxs_id_to_revoke); + + rsGxsCircles->revokeIdsFromCircle(ids,circle_id); + }); } void IdDialog::acceptCircleSubscription()