From 15f5a1fdc90169b097bd268454b21257ee1871be Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Thu, 19 Apr 2018 00:58:30 -0400 Subject: [PATCH] Closes #342 - adds protection for undefined message --- CHANGELOG.md | 1 + src/annotations/blameAnnotationProvider.ts | 4 +++- src/annotations/recentChangesAnnotationProvider.ts | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a4cae9..05525f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p ### Fixed - Fixes [#345](https://github.com/eamodio/vscode-gitlens/issues/345) - Custom date formats don't work in the GitLens view - Fixes [#336](https://github.com/eamodio/vscode-gitlens/issues/336) - Default Settings Get Added Automatically +- Fixes [#342](https://github.com/eamodio/vscode-gitlens/issues/342) - GitLens crashes while debugging with Chrome Debugger a larger project - Fixes issue where username and/or password in a remote urls could be shown ## [8.2.1] - 2018-04-11 diff --git a/src/annotations/blameAnnotationProvider.ts b/src/annotations/blameAnnotationProvider.ts index c27a655..f9700c7 100644 --- a/src/annotations/blameAnnotationProvider.ts +++ b/src/annotations/blameAnnotationProvider.ts @@ -130,7 +130,9 @@ export abstract class BlameAnnotationProviderBase extends AnnotationProviderBase if (commit === undefined) return undefined; const hover = await Annotations.changesHover(commit, position.line, await GitUri.fromUri(document.uri)); - return new Hover(hover.hoverMessage!, document.validateRange(new Range(position.line, 0, position.line, RangeEndOfLineIndex))); + if (hover.hoverMessage === undefined) return undefined; + + return new Hover(hover.hoverMessage, document.validateRange(new Range(position.line, 0, position.line, RangeEndOfLineIndex))); } private async getCommitForHover(position: Position): Promise { diff --git a/src/annotations/recentChangesAnnotationProvider.ts b/src/annotations/recentChangesAnnotationProvider.ts index 64a1b77..1c4c16c 100644 --- a/src/annotations/recentChangesAnnotationProvider.ts +++ b/src/annotations/recentChangesAnnotationProvider.ts @@ -63,6 +63,7 @@ export class RecentChangesAnnotationProvider extends AnnotationProviderBase { if (cfg.hovers.annotations.changes) { message = Annotations.getHoverDiffMessage(commit, this._uri, line); + if (message === undefined) continue; } }