Fixed #2142 XML Export - string values containing only spaces

Fixed AS3 - Nullpointer in MethodBody when no ABC set
This commit is contained in:
Jindra Petřík
2023-12-30 18:06:08 +01:00
parent 2596650ed3
commit 7c2e41b1a9
4 changed files with 17 additions and 4 deletions
@@ -144,13 +144,15 @@ public final class MethodBody implements Cloneable {
}
}
public synchronized AVM2Code getCode() {
public synchronized AVM2Code getCode() {
if (code == null) {
AVM2Code avm2Code;
try {
ABCInputStream ais = new ABCInputStream(new MemoryInputStream(codeBytes));
avm2Code = new AVM2Code(ais, this);
avm2Code.removeWrongIndices(abc.constants);
if (abc != null) {
avm2Code.removeWrongIndices(abc.constants);
}
} catch (UnknownInstructionCode | IOException ex) {
avm2Code = new AVM2Code();
logger.log(Level.SEVERE, null, ex);