From 579c241a47d491ff58a7d72ac12512508f1345a5 Mon Sep 17 00:00:00 2001 From: Hanna Walter Date: Tue, 26 Oct 2021 18:22:09 -0600 Subject: [PATCH] fix: padder out of range exception --- Export Layers To Files (Fast).jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Export Layers To Files (Fast).jsx b/Export Layers To Files (Fast).jsx index 6b1bd14..9d201a9 100755 --- a/Export Layers To Files (Fast).jsx +++ b/Export Layers To Files (Fast).jsx @@ -2184,7 +2184,8 @@ function exportPng8AM(fileName, options) { function padder(input, padLength) { // pad the input with zeroes up to indicated length - var result = (new Array(padLength + 1 - input.toString().length)).join('0') + input; + var length = padLength + 1 - input.toString().length; + var result = (new Array(Math.max(length, 0))).join('0') + input; return result; }