Skip to content

Commit

Permalink
Trimmed space from json forat string
Browse files Browse the repository at this point in the history
Json string sometimes can mistakenly contain spaces
and if so it will fail on conditional check
  • Loading branch information
hrskrs committed Feb 15, 2016
1 parent 7ed3559 commit 3109fd9
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ final class LoggerPrinter implements Printer {
return;
}
try {
json = json.trim();
if (json.startsWith("{")) {
JSONObject jsonObject = new JSONObject(json);
String message = jsonObject.toString(JSON_INDENT);
Expand Down

0 comments on commit 3109fd9

Please sign in to comment.