diff --git a/index.js b/index.js index cee260d..1d985ab 100644 --- a/index.js +++ b/index.js @@ -496,7 +496,10 @@ const linkDetail = (element, filename) => { const createAnimation = (prop, animation) => { const frames = [] for (let istate = animation.startState; istate <= animation.endState; istate ++) { - frames.push(compositeCels(celsFromMask(prop, prop.celmasks[istate]))) + const frame = compositeCels(celsFromMask(prop, prop.celmasks[istate])) + if (frame != null) { + frames.push(frame) + } } if (frames.length == 1) { return imageFromCanvas(frames[0].canvas)