Fixed #1921 AS3 direct editation - exception on code save - wrong selected ABC

This commit is contained in:
Jindra Petřík
2022-12-28 09:20:37 +01:00
parent 9689f16a4b
commit 8d7ecce4c0
3 changed files with 12 additions and 7 deletions
@@ -2640,15 +2640,15 @@ public class ActionScript3Parser {
try {
SWF.initPlayer();
ABC abc = new ABC(null);
ActionScript3Parser parser = new ActionScript3Parser(swf.getAbcIndex());
AbcIndexing abcIndex = swf.getAbcIndex();
abcIndex.selectAbc(abc);
ActionScript3Parser parser = new ActionScript3Parser(abcIndex);
parser.addScript(new String(Helper.readFile(src), Utf8Helper.charset), src, classPos, scriptIndex);
try ( OutputStream fos = new BufferedOutputStream(new FileOutputStream(new File(dst)))) {
abc.saveToStream(fos);
}
} catch (Exception ex) {
Logger.getLogger(ActionScript3Parser.class
.getName()).log(Level.SEVERE, null, ex);
Logger.getLogger(ActionScript3Parser.class.getName()).log(Level.SEVERE, null, ex);
}
System.exit(0);
}