From c89121fc5fdc2999654ea9ad2f7a0c82d50ac74d Mon Sep 17 00:00:00 2001 From: Andre601 <11576465+Andre601@users.noreply.github.com> Date: Thu, 14 Jan 2021 15:08:50 +0100 Subject: [PATCH 1/2] Fix IllegalArgumentException fo UUID.fromString --- src/main/java/tsp/headdb/database/HeadDatabase.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/tsp/headdb/database/HeadDatabase.java b/src/main/java/tsp/headdb/database/HeadDatabase.java index 1b75f49..d9b6190 100644 --- a/src/main/java/tsp/headdb/database/HeadDatabase.java +++ b/src/main/java/tsp/headdb/database/HeadDatabase.java @@ -126,9 +126,11 @@ public class HeadDatabase { JSONArray array = (JSONArray) parser.parse(response.toString()); for (Object o : array) { JSONObject obj = (JSONObject) o; + String uuid = obj.get("uuid").toString(); + Head head = new Head(id) .withName(obj.get("name").toString()) - .withUUID(UUID.fromString(obj.get("uuid").toString())) + .withUUID(uuid.isEmpty() ? UUID.randomUUID() : UUID.fromString(uuid)) .withValue(obj.get("value").toString()) .withCategory(category); From e1b1514e3555548e167617ff41c9e5f4b6f4db4f Mon Sep 17 00:00:00 2001 From: Silent Date: Sat, 16 Jan 2021 21:00:16 +0100 Subject: [PATCH 2/2] Push to fixed version --- pom.xml | 2 +- src/main/resources/plugin.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 84587f7..1f5425b 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ tsp.headdb HeadDB - 2.1 + 2.2 jar HeadDB diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 96c4c5b..d619f4f 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -2,7 +2,7 @@ name: HeadDB description: Database with thousands of heads main: tsp.headdb.HeadDB -version: 2.1 +version: 2.2 api-version: 1.16 author: Silent