Skip to content

Commit

Permalink
#507 added check for undefined (#573)
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiaslohr authored Sep 24, 2024
1 parent a3ec488 commit de0cb50
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/sandbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -935,6 +935,11 @@ module.exports.cli = {
return;
}

// set as empty array, in case the original list came undefined
if ( typeof list !== 'object' ) {
list = [];
}

if (sortBy) {
list = require('./json').sort(list, sortBy);
}
Expand Down

0 comments on commit de0cb50

Please sign in to comment.