mirror of
https://github.com/oxen-io/session-android.git
synced 2025-04-03 16:55:39 +00:00
Fix minor crash.
This commit is contained in:
parent
5e5309d07e
commit
fdba9023fc
@ -278,11 +278,13 @@ public class ApplicationContext extends MultiDexApplication implements Dependenc
|
|||||||
public @Nullable LokiPublicChatAPI getLokiPublicChatAPI() {
|
public @Nullable LokiPublicChatAPI getLokiPublicChatAPI() {
|
||||||
if (lokiPublicChatAPI == null && IdentityKeyUtil.hasIdentityKey(this)) {
|
if (lokiPublicChatAPI == null && IdentityKeyUtil.hasIdentityKey(this)) {
|
||||||
String userHexEncodedPublicKey = TextSecurePreferences.getLocalNumber(this);
|
String userHexEncodedPublicKey = TextSecurePreferences.getLocalNumber(this);
|
||||||
|
if (userHexEncodedPublicKey != null) {
|
||||||
byte[] userPrivateKey = IdentityKeyUtil.getIdentityKeyPair(this).getPrivateKey().serialize();
|
byte[] userPrivateKey = IdentityKeyUtil.getIdentityKeyPair(this).getPrivateKey().serialize();
|
||||||
LokiAPIDatabase apiDatabase = DatabaseFactory.getLokiAPIDatabase(this);
|
LokiAPIDatabase apiDatabase = DatabaseFactory.getLokiAPIDatabase(this);
|
||||||
LokiUserDatabase userDatabase = DatabaseFactory.getLokiUserDatabase(this);
|
LokiUserDatabase userDatabase = DatabaseFactory.getLokiUserDatabase(this);
|
||||||
lokiPublicChatAPI = new LokiPublicChatAPI(userHexEncodedPublicKey, userPrivateKey, apiDatabase, userDatabase);
|
lokiPublicChatAPI = new LokiPublicChatAPI(userHexEncodedPublicKey, userPrivateKey, apiDatabase, userDatabase);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return lokiPublicChatAPI;
|
return lokiPublicChatAPI;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user