Skip to content

Commit

Permalink
Fix NPE for group members
Browse files Browse the repository at this point in the history
  • Loading branch information
tretdm committed Jun 15, 2023
1 parent c8326d4 commit 73dc179
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,11 @@ public void parseMembers(String response, DownloadManager downloadManager, boole
JSONObject user = members.getJSONObject(i);
member.first_name = user.getString("name").split(" ")[0];
if(user.getString("name").split(" ").length > 1) {
member.last_name = user.getString("name").split(" ")[1];
if(user.getString("name").split(" ")[1] != null) {
member.last_name = user.getString("name").split(" ")[1];
} else {
member.last_name = "";
}
}
member.id = user.getLong("id");
member.avatar_url = user.getString("photo_100");
Expand Down

0 comments on commit 73dc179

Please sign in to comment.