Skip to content

Commit

Permalink
Adds protection against missing file names - related to #568
Browse files Browse the repository at this point in the history
  • Loading branch information
eamodio committed Dec 5, 2018
1 parent 6a7b478 commit ea92ba9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/git/gitUri.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ export class GitUri extends ((Uri as any) as UriEx) {

const normalizedRepoPath = Strings.normalizePath(repoPath);

if (normalizedFileName.startsWith(normalizedRepoPath)) return normalizedFileName;
if (!normalizedFileName || normalizedFileName.startsWith(normalizedRepoPath)) return normalizedFileName;
return Strings.normalizePath(paths.join(normalizedRepoPath, normalizedFileName));
}

Expand Down

0 comments on commit ea92ba9

Please sign in to comment.