From e450f7a0822828c619604037bdacaf983dd53f7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Thu, 11 Feb 2021 20:05:23 +0100 Subject: [PATCH] Fixed #1407 NullPointer on Save as in BinaryData SWF subtree --- CHANGELOG.md | 1 + src/com/jpexs/decompiler/flash/gui/Main.java | 2 +- src/com/jpexs/decompiler/flash/gui/MainFrameMenu.java | 4 +++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 672228a42..75aca97ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ All notable changes to this project will be documented in this file. - #1159 Regexp syntax hilight when not a regexp (only division) - #1227 AS3 avoid recursion (stackoverflow) caused by newfunction instruction - #1360 Precedence of increment/decrement operations +- #1407 NullPointer on Save as in BinaryData SWF subtree ## [13.0.2] - 2021-02-10 ### Changed diff --git a/src/com/jpexs/decompiler/flash/gui/Main.java b/src/com/jpexs/decompiler/flash/gui/Main.java index fbe4a0b48..ddc1b31ed 100644 --- a/src/com/jpexs/decompiler/flash/gui/Main.java +++ b/src/com/jpexs/decompiler/flash/gui/Main.java @@ -951,7 +951,7 @@ public class Main { } public static void saveFile(SWF swf, String outfile, SaveFileMode mode, ExeExportMode exeExportMode) throws IOException { - if (mode == SaveFileMode.SAVEAS && !swf.swfList.isBundle()) { + if (mode == SaveFileMode.SAVEAS && swf.swfList!= null /*SWF in binarydata has null*/ && !swf.swfList.isBundle()) { swf.setFile(outfile); swf.swfList.sourceInfo.setFile(outfile); } diff --git a/src/com/jpexs/decompiler/flash/gui/MainFrameMenu.java b/src/com/jpexs/decompiler/flash/gui/MainFrameMenu.java index 9dc4284ef..80deb7b66 100644 --- a/src/com/jpexs/decompiler/flash/gui/MainFrameMenu.java +++ b/src/com/jpexs/decompiler/flash/gui/MainFrameMenu.java @@ -180,7 +180,9 @@ public abstract class MainFrameMenu implements MenuBuilder { if (swf != null) { if (saveAs(swf, SaveFileMode.SAVEAS)) { - swf.clearModified(); + if (swf.swfList != null) { //binarydata won't clear modified on saveas + swf.clearModified(); + } } return true;