Skip to content

Commit fec4c8e

Browse files
authored
Fix types on CopyPasteController.get (#200600)
Fixes #200597
1 parent 61c2876 commit fec4c8e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/vs/editor/contrib/clipboard/browser/clipboard.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ if (PasteAction) {
229229
if (focusedEditor && focusedEditor.hasTextFocus()) {
230230
const result = focusedEditor.getContainerDomNode().ownerDocument.execCommand('paste');
231231
if (result) {
232-
return CopyPasteController.get(focusedEditor).finishedPaste();
232+
return CopyPasteController.get(focusedEditor)?.finishedPaste() ?? Promise.resolve();
233233
} else if (platform.isWeb) {
234234
// Use the clipboard service if document.execCommand('paste') was not successful
235235
return (async () => {

src/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ export class CopyPasteController extends Disposable implements IEditorContributi
5151

5252
public static readonly ID = 'editor.contrib.copyPasteActionController';
5353

54-
public static get(editor: ICodeEditor): CopyPasteController {
55-
return editor.getContribution<CopyPasteController>(CopyPasteController.ID)!;
54+
public static get(editor: ICodeEditor): CopyPasteController | null {
55+
return editor.getContribution<CopyPasteController>(CopyPasteController.ID);
5656
}
5757

5858
private readonly _editor: ICodeEditor;

0 commit comments

Comments
 (0)