Skip to content

Commit

Permalink
Fixes #9: Check for the description being a JSON object and grab the …
Browse files Browse the repository at this point in the history
…text field from it if it is.
  • Loading branch information
justdave committed Mar 5, 2016
1 parent 6eb61e7 commit ca33554
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/src/main/java/net/justdave/mcstatus/MinecraftServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ public String serverVersion() {
public String description() {
StringBuilder result = new StringBuilder();
String desc = serverJSON.optString("description");
if (serverJSON.optJSONObject("description") != null) {
desc = serverJSON.optJSONObject("description").optString("text");
}
result.append("<body style='background-color: transparent; color: white; margin: 0; padding: 0;'><span>");
int curChar = 0;
String color = "";
Expand Down

0 comments on commit ca33554

Please sign in to comment.