mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-11-23 02:25:19 +01:00
Fix issue with formatting :) (fixes quotes)
This commit is contained in:
parent
f462ff9e8a
commit
0d0e1c16ea
@ -656,11 +656,15 @@ public class OutgoingTransformer {
|
|||||||
if (line == null || line.equalsIgnoreCase("null")) {
|
if (line == null || line.equalsIgnoreCase("null")) {
|
||||||
line = "{\"text\":\"\"}";
|
line = "{\"text\":\"\"}";
|
||||||
} else {
|
} else {
|
||||||
if (!line.startsWith("\"") && !line.startsWith("{"))
|
if (!line.startsWith("\"") && !line.startsWith("{")) {
|
||||||
line = "\"" + line + "\"";
|
JSONObject obj = new JSONObject();
|
||||||
if (line.startsWith("\""))
|
obj.put("text", line);
|
||||||
|
line = obj.toJSONString();
|
||||||
|
}
|
||||||
|
if (line.startsWith("\"")) {
|
||||||
line = "{\"text\":" + line + "}";
|
line = "{\"text\":" + line + "}";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
new JSONParser().parse(line);
|
new JSONParser().parse(line);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
Loading…
Reference in New Issue
Block a user