mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 02:20:39 +00:00
Prevent groupV2Operations from being null
This commit is contained in:
parent
fddf982832
commit
81d2e315e3
2 changed files with 5 additions and 9 deletions
|
@ -60,6 +60,7 @@ public class RegistrationManagerImpl implements RegistrationManager {
|
|||
private final ServiceEnvironmentConfig serviceEnvironmentConfig;
|
||||
private final String userAgent;
|
||||
private final Consumer<Manager> newManagerListener;
|
||||
private final GroupsV2Operations groupsV2Operations;
|
||||
|
||||
private final SignalServiceAccountManager accountManager;
|
||||
private final PinHelper pinHelper;
|
||||
|
@ -80,13 +81,8 @@ public class RegistrationManagerImpl implements RegistrationManager {
|
|||
this.userAgent = userAgent;
|
||||
this.newManagerListener = newManagerListener;
|
||||
|
||||
GroupsV2Operations groupsV2Operations;
|
||||
try {
|
||||
groupsV2Operations = new GroupsV2Operations(ClientZkOperations.create(serviceEnvironmentConfig.signalServiceConfiguration()),
|
||||
ServiceConfig.GROUP_MAX_SIZE);
|
||||
} catch (Throwable ignored) {
|
||||
groupsV2Operations = null;
|
||||
}
|
||||
groupsV2Operations = new GroupsV2Operations(ClientZkOperations.create(serviceEnvironmentConfig.signalServiceConfiguration()),
|
||||
ServiceConfig.GROUP_MAX_SIZE);
|
||||
this.accountManager = new SignalServiceAccountManager(serviceEnvironmentConfig.signalServiceConfiguration(),
|
||||
new DynamicCredentialsProvider(
|
||||
// Using empty UUID, because registering doesn't work otherwise
|
||||
|
@ -210,7 +206,7 @@ public class RegistrationManagerImpl implements RegistrationManager {
|
|||
final var accountManager = new SignalServiceAccountManager(serviceEnvironmentConfig.signalServiceConfiguration(),
|
||||
account.getCredentialsProvider(),
|
||||
userAgent,
|
||||
null,
|
||||
groupsV2Operations,
|
||||
ServiceConfig.AUTOMATIC_NETWORK_RETRY);
|
||||
accountManager.setAccountAttributes(account.getAccountAttributes(null));
|
||||
account.setRegistered(true);
|
||||
|
|
|
@ -142,7 +142,7 @@ public class SignalDependencies {
|
|||
|
||||
private ClientZkProfileOperations getClientZkProfileOperations() {
|
||||
final var clientZkOperations = getClientZkOperations();
|
||||
return clientZkOperations == null ? null : clientZkOperations.getProfileOperations();
|
||||
return clientZkOperations.getProfileOperations();
|
||||
}
|
||||
|
||||
public SignalWebSocket getSignalWebSocket() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue