From bc9a31421ebb2e2ff0d82d9340843d510b5287f4 Mon Sep 17 00:00:00 2001 From: "honfika@gmail.com" Date: Sun, 20 Mar 2016 17:43:44 +0100 Subject: [PATCH] #1210 Frame Export - CANVAS mode showing Java Lang Null pointer Error for certain .swfs --- .../exporters/shape/CanvasShapeExporter.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/shape/CanvasShapeExporter.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/shape/CanvasShapeExporter.java index 46add5969..06c6c636f 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/shape/CanvasShapeExporter.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/shape/CanvasShapeExporter.java @@ -429,12 +429,15 @@ public class CanvasShapeExporter extends ShapeExporterBase { preLineFillData.append("\tctx.fillStyle=").append(lineLastRadColor).append(";\r\n\tctx.fill(\"evenodd\");\r\n"); } - preLineFillData.append("\tctx.transform(").append(Helper.doubleStr(lineFillMatrix.scaleX / unitDivisor)) - .append(",").append(Helper.doubleStr(lineFillMatrix.rotateSkew0 / unitDivisor)) - .append(",").append(Helper.doubleStr(lineFillMatrix.rotateSkew1 / unitDivisor)) - .append(",").append(Helper.doubleStr(lineFillMatrix.scaleY / unitDivisor)) - .append(",").append(Helper.doubleStr((lineFillMatrix.translateX + deltaX) / unitDivisor)) - .append(",").append(Helper.doubleStr((lineFillMatrix.translateY + deltaY) / unitDivisor)).append(");\r\n"); + if (lineFillMatrix != null) { + preLineFillData.append("\tctx.transform(").append(Helper.doubleStr(lineFillMatrix.scaleX / unitDivisor)) + .append(",").append(Helper.doubleStr(lineFillMatrix.rotateSkew0 / unitDivisor)) + .append(",").append(Helper.doubleStr(lineFillMatrix.rotateSkew1 / unitDivisor)) + .append(",").append(Helper.doubleStr(lineFillMatrix.scaleY / unitDivisor)) + .append(",").append(Helper.doubleStr((lineFillMatrix.translateX + deltaX) / unitDivisor)) + .append(",").append(Helper.doubleStr((lineFillMatrix.translateY + deltaY) / unitDivisor)).append(");\r\n"); + } + lineFillData.insert(0, preLineFillData); lineFillData.append("\tctx.fillRect(").append(-16384 - 32768 * lineRepeatCnt).append(",").append(-16384 - 32768 * lineRepeatCnt).append(",").append(2 * 16384 + 32768 * 2 * lineRepeatCnt).append(",").append(2 * 16384 + 32768 * 2 * lineRepeatCnt).append(");\r\n");