mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-19 04:15:14 -04:00
display wrong parsed TextComponent exception
This commit is contained in:
parent
19afdf26ef
commit
bf238f5ddd
@ -13,6 +13,7 @@
|
|||||||
|
|
||||||
package de.bixilon.minosoft.data.text;
|
package de.bixilon.minosoft.data.text;
|
||||||
|
|
||||||
|
import com.google.gson.JsonObject;
|
||||||
import com.google.gson.JsonParseException;
|
import com.google.gson.JsonParseException;
|
||||||
import com.google.gson.JsonParser;
|
import com.google.gson.JsonParser;
|
||||||
import javafx.collections.FXCollections;
|
import javafx.collections.FXCollections;
|
||||||
@ -30,11 +31,13 @@ public abstract class ChatComponent {
|
|||||||
if (raw == null) {
|
if (raw == null) {
|
||||||
return new BaseComponent();
|
return new BaseComponent();
|
||||||
}
|
}
|
||||||
|
JsonObject json;
|
||||||
try {
|
try {
|
||||||
return new BaseComponent(parent, JsonParser.parseString(raw).getAsJsonObject());
|
json = JsonParser.parseString(raw).getAsJsonObject();
|
||||||
} catch (JsonParseException | IllegalStateException ignored) {
|
} catch (JsonParseException | IllegalStateException ignored) {
|
||||||
|
return new BaseComponent(raw);
|
||||||
}
|
}
|
||||||
return new BaseComponent(raw);
|
return new BaseComponent(parent, json);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user