Merge pull request #4

Fix IllegalArgumentException fo UUID.fromString
Dieser Commit ist enthalten in:
Silent 2021-01-16 20:53:08 +01:00 committet von GitHub
Commit 247e0ccfbd
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23

Datei anzeigen

@ -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);