Skip to content

Commit

Permalink
Fixes #751 - adds null ref protection
Browse files Browse the repository at this point in the history
  • Loading branch information
eamodio committed Jun 11, 2019
1 parent 43caac1 commit 10f46a1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/git/gitService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1764,7 +1764,7 @@ export class GitService implements Disposable {
skip === 0
? GitUri.fromFile(fileName, repoPath, ref)
: (await this.getPreviousUri(repoPath, uri, undefined, skip - 1))!;
if (current.sha === GitService.deletedOrMissingSha) return undefined;
if (current === undefined || current.sha === GitService.deletedOrMissingSha) return undefined;

return {
current: current,
Expand All @@ -1777,7 +1777,7 @@ export class GitService implements Disposable {
skip === 0
? GitUri.fromFile(fileName, repoPath, ref)
: (await this.getPreviousUri(repoPath, uri, ref, skip - 1))!;
if (current.sha === GitService.deletedOrMissingSha) return undefined;
if (current === undefined || current.sha === GitService.deletedOrMissingSha) return undefined;

return {
current: current,
Expand Down

0 comments on commit 10f46a1

Please sign in to comment.