From 3109fd932518b85922228c995cfd62107f0c76a2 Mon Sep 17 00:00:00 2001 From: Haris Krasniqi Date: Mon, 15 Feb 2016 13:55:19 +0200 Subject: [PATCH] Trimmed space from json forat string Json string sometimes can mistakenly contain spaces and if so it will fail on conditional check --- logger/src/main/java/com/orhanobut/logger/LoggerPrinter.java | 1 + 1 file changed, 1 insertion(+) diff --git a/logger/src/main/java/com/orhanobut/logger/LoggerPrinter.java b/logger/src/main/java/com/orhanobut/logger/LoggerPrinter.java index 75de5b37..a81a5063 100644 --- a/logger/src/main/java/com/orhanobut/logger/LoggerPrinter.java +++ b/logger/src/main/java/com/orhanobut/logger/LoggerPrinter.java @@ -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);