From a9cc2841acab2ac4372833f2c76d56cf03b8b96b Mon Sep 17 00:00:00 2001 From: Gravit Date: Fri, 22 Mar 2019 09:55:30 +0700 Subject: [PATCH] =?UTF-8?q?[FIX]=20=D0=A4=D0=B8=D0=BA=D1=81=20=D0=BE=D1=82?= =?UTF-8?q?=D0=BF=D1=80=D0=B0=D0=B2=D0=BA=D0=B8=20json=20=D0=B7=D0=B0?= =?UTF-8?q?=D0=BF=D1=80=D0=BE=D1=81=D0=BE=D0=B2=20=D0=BA=20mojang?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/ru/gravit/utils/HTTPRequest.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libLauncher/src/main/java/ru/gravit/utils/HTTPRequest.java b/libLauncher/src/main/java/ru/gravit/utils/HTTPRequest.java index dacf0164..393d7d87 100644 --- a/libLauncher/src/main/java/ru/gravit/utils/HTTPRequest.java +++ b/libLauncher/src/main/java/ru/gravit/utils/HTTPRequest.java @@ -58,8 +58,12 @@ public static JsonElement jsonRequest(JsonElement request, URL url) throws IOExc reader = new InputStreamReader(connection.getInputStream(), StandardCharsets.UTF_8); else reader = new InputStreamReader(connection.getErrorStream(), StandardCharsets.UTF_8); - JsonElement content = parser.parse(reader); - return content; + try { + return parser.parse(reader); + } catch (Exception e) + { + return null; + } } private HTTPRequest() {