Skip to content

Commit

Permalink
Merge pull request #165 from hsw107/hanna/fix/160/padder-issue
Browse files Browse the repository at this point in the history
fix: padder out of range exception
  • Loading branch information
antipalindrome authored Oct 27, 2021
2 parents 2b8c4cd + 579c241 commit 92960c3
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 92960c3

Please sign in to comment.