From cc6c6dab3d86b26c098c63efc2fdc713aeacf5ae Mon Sep 17 00:00:00 2001 From: nielsandriesse Date: Wed, 19 Aug 2020 16:32:15 +1000 Subject: [PATCH] Fix legacy closed group messaging --- .../securesms/loki/protocol/ClosedGroupsProtocol.kt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/org/thoughtcrime/securesms/loki/protocol/ClosedGroupsProtocol.kt b/src/org/thoughtcrime/securesms/loki/protocol/ClosedGroupsProtocol.kt index 71093220c8..3df6187a7b 100644 --- a/src/org/thoughtcrime/securesms/loki/protocol/ClosedGroupsProtocol.kt +++ b/src/org/thoughtcrime/securesms/loki/protocol/ClosedGroupsProtocol.kt @@ -411,8 +411,13 @@ object ClosedGroupsProtocol { if (GroupUtil.isOpenGroup(groupID)) { return listOf( Address.fromSerialized(groupID) ) } else { - val groupPublicKey = doubleDecodeGroupID(groupID).toHexString() - if (DatabaseFactory.getSSKDatabase(context).isSSKBasedClosedGroup(groupPublicKey)) { + var groupPublicKey: String? = null + try { + groupPublicKey = doubleDecodeGroupID(groupID).toHexString() + } catch (exception: Exception) { + // Do nothing + } + if (groupPublicKey != null && DatabaseFactory.getSSKDatabase(context).isSSKBasedClosedGroup(groupPublicKey)) { return listOf( Address.fromSerialized(groupPublicKey) ) } else { return DatabaseFactory.getGroupDatabase(context).getGroupMembers(groupID, false).map { it.address }