Skip to content

Commit cee9d5a

Browse files
authored
Merge pull request #115 from lingyuncai/master
Fix for using depth option without attributes option set
2 parents 1c1d350 + 4f43210 commit cee9d5a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/directory-tree.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ function isRegExp(regExp) {
5151
function directoryTree (path, options, onEachFile, onEachDirectory, currentDepth = 0) {
5252
options = options || {};
5353

54-
if (options.depth !== undefined && options.attributes.indexOf('size') !== -1) {
54+
if (options.depth !== undefined && options.attributes && options.attributes.indexOf('size') !== -1) {
5555
throw new Error('usage of size attribute with depth option is prohibited');
5656
}
5757

0 commit comments

Comments
 (0)