mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-20 08:39:22 +01:00
Prevent ZkGroup link crashes.
This commit is contained in:
@@ -507,4 +507,7 @@ public final class FeatureFlags {
|
||||
|
||||
/** Read and write versioned profile information. */
|
||||
public static final boolean VERSIONED_PROFILES = org.whispersystems.signalservice.FeatureFlags.VERSIONED_PROFILES;
|
||||
|
||||
/** Enabled ZKGroups library. */
|
||||
public static final boolean ZK_GROUPS = org.whispersystems.signalservice.FeatureFlags.ZK_GROUPS;
|
||||
}
|
||||
|
||||
@@ -41,6 +41,9 @@ public final class GroupUtil {
|
||||
if (groupContext.getGroupV1().isPresent()) {
|
||||
return GroupId.v1(groupContext.getGroupV1().get().getGroupId());
|
||||
} else if (groupContext.getGroupV2().isPresent()) {
|
||||
if (!FeatureFlags.ZK_GROUPS) {
|
||||
throw new BadGroupIdException();
|
||||
}
|
||||
return GroupId.v2(groupContext.getGroupV2().get().getMasterKey());
|
||||
} else {
|
||||
throw new AssertionError();
|
||||
|
||||
Reference in New Issue
Block a user