mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-26 04:51:03 +00:00
Fixed #2142 XML Export - string values containing only spaces
Fixed AS3 - Nullpointer in MethodBody when no ABC set
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -53,7 +53,7 @@ import javax.xml.stream.XMLStreamWriter;
|
||||
public class SwfXmlExporter {
|
||||
|
||||
public static final int XML_EXPORT_VERSION_MAJOR = 2;
|
||||
public static final int XML_EXPORT_VERSION_MINOR = 0;
|
||||
public static final int XML_EXPORT_VERSION_MINOR = 1;
|
||||
|
||||
private static final Logger logger = Logger.getLogger(SwfXmlExporter.class.getName());
|
||||
|
||||
@@ -158,7 +158,7 @@ public class SwfXmlExporter {
|
||||
|
||||
if (isListItem) {
|
||||
writer.writeStartElement(name);
|
||||
writer.writeCharacters(stringValue);
|
||||
writer.writeCharacters(stringValue);
|
||||
writer.writeEndElement();
|
||||
} else {
|
||||
writer.writeAttribute(name, stringValue);
|
||||
|
||||
@@ -1321,6 +1321,14 @@ public class Helper {
|
||||
}
|
||||
|
||||
public static String escapeXmlExportString(String s) {
|
||||
if (s.matches("^ +$")) {
|
||||
StringBuilder ret = new StringBuilder(s.length());
|
||||
for (int i = 0; i < s.length(); i++) {
|
||||
ret.append("\\u0020");
|
||||
}
|
||||
return ret.toString();
|
||||
}
|
||||
|
||||
StringBuilder ret = new StringBuilder(s.length());
|
||||
for (int i = 0; i < s.length(); i++) {
|
||||
char c = s.charAt(i);
|
||||
|
||||
Reference in New Issue
Block a user