diff --git a/CHANGELOG.md b/CHANGELOG.md index c273ab74b..50ce82363 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -77,6 +77,7 @@ All notable changes to this project will be documented in this file. - [#2145] FLA Export - missing frames, cliping layers order, nullpointer, empty sound layers - [#2142] XML Export - string values containing only spaces - AS3 - Nullpointer in MethodBody when no ABC set +- [#2148] AS2 Uninitialized class fields detector ### Changed - [#2120] Exported assets no longer take names from assigned classes if there is more than 1 assigned class @@ -3355,6 +3356,7 @@ Major version of SWF to XML export changed to 2. [#2139]: https://www.free-decompiler.com/flash/issues/2139 [#2145]: https://www.free-decompiler.com/flash/issues/2145 [#2142]: https://www.free-decompiler.com/flash/issues/2142 +[#2148]: https://www.free-decompiler.com/flash/issues/2148 [#2120]: https://www.free-decompiler.com/flash/issues/2120 [#1130]: https://www.free-decompiler.com/flash/issues/1130 [#1220]: https://www.free-decompiler.com/flash/issues/1220 diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/as2/UninitializedClassFieldsDetector.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/as2/UninitializedClassFieldsDetector.java index 8be6bd9c0..4910ffb96 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/as2/UninitializedClassFieldsDetector.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/as2/UninitializedClassFieldsDetector.java @@ -313,24 +313,27 @@ public class UninitializedClassFieldsDetector { AbstractGraphTargetVisitor visitor = new AbstractGraphTargetVisitor() { @Override public void visit(GraphTargetItem item) { - if (item instanceof SetMemberActionItem) { - if (item instanceof SetMemberActionItem) { - List path = getFullPath(item); - if (path != null) { - List parent = new ArrayList<>(path); - parent.remove(parent.size() - 1); - String name = path.get(path.size() - 1); + if ((item instanceof SetMemberActionItem) + || (item instanceof CallMethodActionItem) + || (item instanceof NewMethodActionItem) + || (item instanceof DeleteActionItem) + || (item instanceof GetMemberActionItem) + ) { + List path = getFullPath(item); + if (path != null) { + List parent = new ArrayList<>(path); + parent.remove(parent.size() - 1); + String name = path.get(path.size() - 1); - String className = String.join(".", parent); - if (classInheritance.containsKey(className)) { - //it's a class - if (!containsTrait(classTraits, classInheritance, className, name) && (!result.containsKey(className) || !result.get(className).containsKey(name))) { - Variable v = new Variable(true, name, null, className); - if (!result.containsKey(className)) { - result.put(className, new LinkedHashMap<>()); - } - result.get(className).put(name, v); - } + String className = String.join(".", parent); + if (classInheritance.containsKey(className)) { + //it's a class + if (!containsTrait(classTraits, classInheritance, className, name) && (!result.containsKey(className) || !result.get(className).containsKey(name))) { + if (!result.containsKey(className)) { + result.put(className, new LinkedHashMap<>()); + } + Variable v = new Variable(true, name, null, className); + result.get(className).put(name, v); } } }