From f837de74301e760ffaec552e8fd31c54f5831444 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Wed, 1 Mar 2017 01:33:12 -0500 Subject: [PATCH] Fixes issue with copy to clipboard with no active editor --- src/commands/copyMessageToClipboard.ts | 2 +- src/commands/copyShaToClipboard.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/commands/copyMessageToClipboard.ts b/src/commands/copyMessageToClipboard.ts index 06a6efe..0c6b164 100644 --- a/src/commands/copyMessageToClipboard.ts +++ b/src/commands/copyMessageToClipboard.ts @@ -28,11 +28,11 @@ export class CopyMessageToClipboardCommand extends ActiveEditorCommand { return undefined; } - const line = editor.selection.active.line; const gitUri = GitUri.fromUri(uri, this.git); if (!message) { if (!sha) { + const line = editor.selection.active.line; const blameline = line - gitUri.offset; if (blameline < 0) return undefined; diff --git a/src/commands/copyShaToClipboard.ts b/src/commands/copyShaToClipboard.ts index ef212cb..64978f1 100644 --- a/src/commands/copyShaToClipboard.ts +++ b/src/commands/copyShaToClipboard.ts @@ -28,10 +28,10 @@ export class CopyShaToClipboardCommand extends ActiveEditorCommand { return undefined; } - const line = editor.selection.active.line; const gitUri = GitUri.fromUri(uri, this.git); if (!sha) { + const line = editor.selection.active.line; const blameline = line - gitUri.offset; if (blameline < 0) return undefined;