Skip to content

Commit

Permalink
Skip broken badges
Browse files Browse the repository at this point in the history
  • Loading branch information
samfundev committed May 20, 2023
1 parent be731fc commit f7f1a90
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/src/main/java/com/perflyst/twire/chat/ChatManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,11 @@ private void processVodChat() {
JSONArray userBadgesArray = message.getJSONArray("userBadges");
for (int j = 0; j < userBadgesArray.length(); j++) {
JSONObject userBadge = userBadgesArray.getJSONObject(j);
badges.put(userBadge.getString("setID"), userBadge.getString("version"));
String setID = userBadge.getString("setID");
String version = userBadge.getString("version");
if (setID.isEmpty() || version.isEmpty()) continue;

badges.put(setID, version);
}
}

Expand Down Expand Up @@ -677,6 +681,7 @@ private Badge getBadge(String badgeSet, String version) {
if (globalSet != null && globalSet.get(version) != null)
return globalSet.get(version);

Log.e(LOG_TAG, "Badge failed to load: \"" + badgeSet + "\" \"" + version + "\"");
return null;
}

Expand Down

0 comments on commit f7f1a90

Please sign in to comment.