Skip to content

Commit

Permalink
[FIX] Android crashing on receive a notification (#2415)
Browse files Browse the repository at this point in the history
  • Loading branch information
djorkaeffalexandre authored Aug 20, 2020
1 parent 0c55d15 commit a07b4cf
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions android/app/src/main/java/chat/rocket/reactnative/Ejson.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,17 @@ public String getAvatarUri() {
}

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 "";
}
Expand Down

0 comments on commit a07b4cf

Please sign in to comment.