[FIX] Android crashing on receive a notification (#2415)

This commit is contained in:
Djorkaeff Alexandre 2020-08-20 11:48:22 -03:00 committed by GitHub
parent 0c55d15378
commit a07b4cf81d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 4 deletions

View File

@ -67,15 +67,17 @@ public class Ejson {
}
public String token() {
if (mmkv != null) {
return mmkv.decodeString(TOKEN_KEY.concat(userId()));
String userId = userId();
if (mmkv != null && userId != null) {
return mmkv.decodeString(TOKEN_KEY.concat(userId));
}
return "";
}
public String userId() {
if (mmkv != null) {
return mmkv.decodeString(TOKEN_KEY.concat(serverURL()));
String serverURL = serverURL();
if (mmkv != null && serverURL != null) {
return mmkv.decodeString(TOKEN_KEY.concat(serverURL));
}
return "";
}