From c8c548c5a95b49792e67338da58f9fd2c885877b Mon Sep 17 00:00:00 2001 From: "honfika@gmail.com" Date: Sat, 4 Jul 2015 16:35:09 +0200 Subject: [PATCH] handle exceptions in command line export --- .../flash/console/CommandLineArgumentParser.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java b/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java index d666889b9..b16977779 100644 --- a/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java +++ b/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.SWFBundle; import com.jpexs.decompiler.flash.SWFCompression; import com.jpexs.decompiler.flash.SWFSourceInfo; import com.jpexs.decompiler.flash.SearchMode; +import com.jpexs.decompiler.flash.SwfOpenException; import com.jpexs.decompiler.flash.abc.ABC; import com.jpexs.decompiler.flash.abc.RenameType; import com.jpexs.decompiler.flash.abc.ScriptPack; @@ -1086,7 +1087,14 @@ public class CommandLineArgumentParser { } SWFSourceInfo sourceInfo = new SWFSourceInfo(null, inFile.getAbsolutePath(), inFile.getName()); - SWF swf = new SWF(new FileInputStream(inFile), sourceInfo.getFile(), sourceInfo.getFileTitle(), Configuration.parallelSpeedUp.get()); + SWF swf; + try { + swf = new SWF(new FileInputStream(inFile), sourceInfo.getFile(), sourceInfo.getFileTitle(), Configuration.parallelSpeedUp.get()); + } catch (SwfOpenException ex) { + logger.log(Level.SEVERE, "Failed to open swf: " + inFile.getName(), ex); + break; + } + swf.swfList = new SWFList(); swf.swfList.sourceInfo = sourceInfo; String outDir = outDirBase.getAbsolutePath();