From a96283f213d3573913400a1c9ef3a93e00e79bea Mon Sep 17 00:00:00 2001 From: "honfika@gmail.com" Date: Sun, 6 Mar 2016 17:45:15 +0100 Subject: [PATCH] xfl export fix when shape is null --- .../src/com/jpexs/decompiler/flash/tags/base/ShapeTag.java | 5 ++++- .../src/com/jpexs/decompiler/flash/xfl/XFLConverter.java | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/ShapeTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/ShapeTag.java index a983071ed..2fa7ead29 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/ShapeTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/ShapeTag.java @@ -90,7 +90,10 @@ public abstract class ShapeTag extends CharacterTag implements DrawableTag, Lazy @Override public void getNeededCharacters(Set needed) { - getShapes().getNeededCharacters(needed); + SHAPEWITHSTYLE shapes = getShapes(); + if (shapes != null) { + getShapes().getNeededCharacters(needed); + } } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/xfl/XFLConverter.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/xfl/XFLConverter.java index 4a81dfaee..c593573c2 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/xfl/XFLConverter.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/xfl/XFLConverter.java @@ -88,6 +88,7 @@ import com.jpexs.decompiler.flash.types.MATRIX; import com.jpexs.decompiler.flash.types.RECT; import com.jpexs.decompiler.flash.types.RGB; import com.jpexs.decompiler.flash.types.RGBA; +import com.jpexs.decompiler.flash.types.SHAPEWITHSTYLE; import com.jpexs.decompiler.flash.types.SOUNDENVELOPE; import com.jpexs.decompiler.flash.types.TEXTRECORD; import com.jpexs.decompiler.flash.types.filters.BEVELFILTER; @@ -1328,7 +1329,11 @@ public class XFLConverter { ShapeTag shape = (ShapeTag) symbol; symbolStr.append(""); symbolStr.append(""); - symbolStr.append(convertShape(characters, null, shape.getShapeNum(), shape.getShapes().shapeRecords, shape.getShapes().fillStyles, shape.getShapes().lineStyles, false, true)); + SHAPEWITHSTYLE shapeWithStyle = shape.getShapes(); + if (shapeWithStyle != null) { + symbolStr.append(convertShape(characters, null, shape.getShapeNum(), shapeWithStyle.shapeRecords, shapeWithStyle.fillStyles, shapeWithStyle.lineStyles, false, true)); + } + symbolStr.append(""); symbolStr.append(""); }