Don't try to get image data for zero sized images

Otherwise "context.getImageData(0, 0, width, height)" throws an exception.
This commit is contained in:
Tapio Koskinen
2020-10-19 13:57:30 +03:00
parent f102e11bbe
commit 3983500601

View File

@@ -832,6 +832,9 @@ function getImageData(layer, frameState) {
}
const width = frameState.size[0];
const height = frameState.size[1];
if (width === 0 || height === 0) {
return null;
}
const container = renderer.renderFrame(frameState, null);
let element;
if (container) {