xfl export fix when shape is null

This commit is contained in:
honfika@gmail.com
2016-03-06 17:45:15 +01:00
parent 421fbf8bc0
commit a96283f213
2 changed files with 10 additions and 2 deletions

View File

@@ -90,7 +90,10 @@ public abstract class ShapeTag extends CharacterTag implements DrawableTag, Lazy
@Override
public void getNeededCharacters(Set<Integer> needed) {
getShapes().getNeededCharacters(needed);
SHAPEWITHSTYLE shapes = getShapes();
if (shapes != null) {
getShapes().getNeededCharacters(needed);
}
}
@Override

View File

@@ -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("<DOMTimeline name=\"Symbol ").append(symbol.getCharacterId()).append("\" currentFrame=\"0\">");
symbolStr.append("<layers>");
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("</layers>");
symbolStr.append("</DOMTimeline>");
}