mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-06 16:25:31 +00:00
fix nullpointer on ActionCloneSprite
ActionScriptObject - return Undefined for missing getMember
This commit is contained in:
@@ -12,9 +12,11 @@
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library.
|
||||
* License along with this library.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.action;
|
||||
|
||||
import com.jpexs.decompiler.flash.ecma.Null;
|
||||
import com.jpexs.decompiler.flash.ecma.Undefined;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
@@ -181,6 +183,6 @@ public class ActionScriptObject implements Cloneable {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return Undefined.INSTANCE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library.
|
||||
* License along with this library.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.action.swf4;
|
||||
|
||||
import com.jpexs.decompiler.flash.BaseLocalData;
|
||||
@@ -21,6 +22,7 @@ import com.jpexs.decompiler.flash.action.ActionScriptObject;
|
||||
import com.jpexs.decompiler.flash.action.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.action.model.CloneSpriteActionItem;
|
||||
import com.jpexs.decompiler.flash.ecma.EcmaScript;
|
||||
import com.jpexs.decompiler.flash.ecma.Undefined;
|
||||
import com.jpexs.decompiler.flash.types.annotations.SWFVersion;
|
||||
import com.jpexs.decompiler.graph.GraphSourceItem;
|
||||
import com.jpexs.decompiler.graph.GraphTargetItem;
|
||||
@@ -53,8 +55,11 @@ public class ActionCloneSprite extends Action {
|
||||
int depth = EcmaScript.toInt32(lda.stack.pop());
|
||||
String source = EcmaScript.toString(lda.stack.pop());
|
||||
String target = EcmaScript.toString(lda.stack.pop());
|
||||
String target = EcmaScript.toString(lda.stack.pop());
|
||||
lda.stage.setMember(target, ((ActionScriptObject) lda.stage.getMember(source)).clone());
|
||||
Object clonedMember = lda.stage.getMember(source);
|
||||
if (clonedMember != Undefined.INSTANCE) {
|
||||
lda.stage.setMember(target, ((ActionScriptObject) clonedMember).clone());
|
||||
lda.stage.addToDisplayList(depth, lda.stage.getMember(target));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user