[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() { public String token() {
if (mmkv != null) { String userId = userId();
return mmkv.decodeString(TOKEN_KEY.concat(userId())); if (mmkv != null && userId != null) {
return mmkv.decodeString(TOKEN_KEY.concat(userId));
} }
return ""; return "";
} }
public String userId() { public String userId() {
if (mmkv != null) { String serverURL = serverURL();
return mmkv.decodeString(TOKEN_KEY.concat(serverURL())); if (mmkv != null && serverURL != null) {
return mmkv.decodeString(TOKEN_KEY.concat(serverURL));
} }
return ""; return "";
} }