From 9f40de3a2cfd43cece715cc60cb8c0fd399c4f35 Mon Sep 17 00:00:00 2001 From: "honfika@gmail.com" Date: Sun, 14 Feb 2016 10:54:18 +0100 Subject: [PATCH] show error message when a text tag is invalid (glyph index is not found in the glyph list) --- src/com/jpexs/decompiler/flash/gui/TextPanel.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/com/jpexs/decompiler/flash/gui/TextPanel.java b/src/com/jpexs/decompiler/flash/gui/TextPanel.java index 47ebfcfac..4be21ded8 100644 --- a/src/com/jpexs/decompiler/flash/gui/TextPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/TextPanel.java @@ -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);