Skip to content

Commit 593e803

Browse files
nickzeleiblakeembrey
authored andcommitted
Fix path crash in SourcePlugin (#463)
1 parent b53f9d3 commit 593e803

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/lib/converter/plugins/SourcePlugin.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,11 @@ export class SourcePlugin extends ConverterComponent {
160160
let directory = home;
161161
const path = Path.dirname(file.fileName);
162162
if (path !== '.') {
163-
path.split('/').forEach((path) => {
164-
if (!Object.prototype.hasOwnProperty.call(directory, path)) {
165-
directory.directories[path] = new SourceDirectory(path, directory);
163+
path.split('/').forEach((pathPiece) => {
164+
if (!Object.prototype.hasOwnProperty.call(directory.directories, pathPiece)) {
165+
directory.directories[pathPiece] = new SourceDirectory(pathPiece, directory);
166166
}
167-
directory = directory.directories[path];
167+
directory = directory.directories[pathPiece];
168168
});
169169
}
170170

0 commit comments

Comments
 (0)