diff --git a/lib/utils/util.js b/lib/utils/util.js index 39daf1c7..c55b3946 100644 --- a/lib/utils/util.js +++ b/lib/utils/util.js @@ -1005,9 +1005,11 @@ util.mkdirp = function mkdirp(path) { path = parts.shift() + '/'; } - if (parts[0].length === 0) { - parts.shift(); - path = '/'; + if (parts.length > 0) { + if (parts[0].length === 0) { + parts.shift(); + path = '/'; + } } for (i = 0; i < parts.length; i++) {