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() {