Fix exception attempting to create text-only animation

This commit is contained in:
Jeremy Penner 2023-12-25 21:47:39 -05:00
parent 053f3b6589
commit 6f4d67d1a5

View file

@ -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)