From 6f4d67d1a5f31969cb59a57a999014ea617f9651 Mon Sep 17 00:00:00 2001 From: Jeremy Penner Date: Mon, 25 Dec 2023 21:47:39 -0500 Subject: [PATCH] Fix exception attempting to create text-only animation --- index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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)