diff --git a/src/vs/workbench/contrib/comments/browser/commentReply.ts b/src/vs/workbench/contrib/comments/browser/commentReply.ts index 8fe2a07420ec6..68eda2e6e390b 100644 --- a/src/vs/workbench/contrib/comments/browser/commentReply.ts +++ b/src/vs/workbench/contrib/comments/browser/commentReply.ts @@ -218,8 +218,8 @@ export class CommentReply extends Disposable { this._commentThreadDisposables.push(this._commentThread.onDidChangeInput(input => { const thread = this._commentThread; - - if (thread.input && thread.input.uri !== commentEditor.getModel()!.uri) { + const model = commentEditor.getModel(); + if (thread.input && model && (thread.input.uri !== model.uri)) { return; } if (!input) {