Skip to content

Commit

Permalink
Fix: Check configs are arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
tgxn committed Jul 9, 2021
1 parent 325d1f3 commit 7132eac
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,15 +252,21 @@ class OrganizerLayer {
}

let allowedFile = false;
if (this.configData.allowedExtensions.length !== 0) {
if (
Array.isArray(this.configData.allowedExtensions) &&
this.configData.allowedExtensions.length !== 0
) {
if (isInArray(this.configData.allowedExtensions, fileExt)) {
allowedFile = true;
}
} else {
allowedFile = true;
}

if (isInArray(this.configData.ignoredExtensions, fileExt)) {
if (
Array.isArray(this.configData.ignoredExtensions) &&
isInArray(this.configData.ignoredExtensions, fileExt)
) {
allowedFile = false;
}

Expand Down

0 comments on commit 7132eac

Please sign in to comment.