mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-06 17:46:16 +00:00
show error message when a text tag is invalid (glyph index is not found in the glyph list)
This commit is contained in:
@@ -173,7 +173,14 @@ public class TextPanel extends JPanel implements TagEditorPanel {
|
||||
|
||||
public void setText(TextTag textTag) {
|
||||
this.textTag = textTag;
|
||||
textValue.setText(textTag.getFormattedText(false).text);
|
||||
String formattedText;
|
||||
try {
|
||||
formattedText = textTag.getFormattedText(false).text;
|
||||
} catch (IndexOutOfBoundsException ex) {
|
||||
formattedText = "Invalid text tag";
|
||||
}
|
||||
|
||||
textValue.setText(formattedText);
|
||||
textValue.setCaretPosition(0);
|
||||
setModified(false);
|
||||
setEditText(false);
|
||||
|
||||
Reference in New Issue
Block a user