Skip to content

Commit

Permalink
fix: padder out of range exception
Browse files Browse the repository at this point in the history
  • Loading branch information
Hanna Walter committed Oct 27, 2021
1 parent 2b8c4cd commit 579c241
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Export Layers To Files (Fast).jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 579c241

Please sign in to comment.