Ver a proveniência

Adds logging for #22 - Cannot read property 'sha' of undefined

main
Eric Amodio há 7 anos
ascendente
cometimento
6c536e9360
1 ficheiros alterados com 9 adições e 2 eliminações
  1. +9
    -2
      src/blameStatusBarController.ts

+ 9
- 2
src/blameStatusBarController.ts Ver ficheiro

@ -4,6 +4,7 @@ import { Disposable, ExtensionContext, StatusBarAlignment, StatusBarItem, TextDo
import { TextDocumentComparer } from './comparers';
import { IConfig, StatusBarCommand } from './configuration';
import GitProvider, { GitCommit, GitUri, IGitBlame } from './gitProvider';
import { Logger } from './logger';
import * as moment from 'moment';
export default class BlameStatusBarController extends Disposable {
@ -108,8 +109,14 @@ export default class BlameStatusBarController extends Disposable {
return;
}
const sha = blame.lines[line].sha;
commit = blame.commits.get(sha);
try {
const sha = blame.lines[line].sha;
commit = blame.commits.get(sha);
}
catch (ex) {
Logger.error(`DEBUG(${this._uri.toString()}): Line ${line} not found in blame; lines=${blame.lines.length}, uriOffset=${this._uri.offset}, repoPath=${blame.repoPath}`);
throw ex;
}
}
else {
const blameLine = await this.git.getBlameForLine(this._uri.fsPath, line, this._uri.sha, this._uri.repoPath);

Carregando…
Cancelar
Guardar