fixed class cast

This commit is contained in:
NEZNAMY committed 2020-10-19 09:23:13 +02:00
1 parent 1a935058ef
commit 10827ffec9
1 file changed
+1 -1
@@ -230,7 +230,7 @@ public class IChatBaseComponent {
JSONObject jsonObject = ((JSONObject) new JSONParser().parse(json));
IChatBaseComponent component = new IChatBaseComponent();
component.setText((String) jsonObject.get("text"));
component.setBold((Boolean) jsonObject.get("bold"));
if (jsonObject.containsKey("bold")) component.setBold(Boolean.parseBoolean((String) jsonObject.get("bold")));
component.setItalic((Boolean) jsonObject.get("italic"));
component.setUnderlined((Boolean) jsonObject.get("underlined"));
component.setStrikethrough((Boolean) jsonObject.get("strikethrough"));