diff --git a/lib/jsdoc/path.js b/lib/jsdoc/path.js index 9e3c4d48..4ddb031d 100644 --- a/lib/jsdoc/path.js +++ b/lib/jsdoc/path.js @@ -16,9 +16,9 @@ function prefixReducer(previousPath, current) { return currentPath; } - currentPath = path.resolve( process.cwd(), path.dirname(current) ).split(path.sep); + currentPath = path.resolve( process.cwd(), path.dirname(current) ).split(path.sep) || []; - if (previousPath) { + if (previousPath && currentPath.length) { // remove chunks that exceed the previous path's length currentPath = currentPath.slice(0, previousPath.length);