提交 036e5f53 编写于 作者: R Ravi Chande

Move assertion into GetDocument() method

上级 ba5fbf15
......@@ -264,12 +264,14 @@ private static bool IsPotentialFilterCharacter(TypeCharCommandArgs args)
private Document GetDocument()
{
return this.SubjectBuffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges();
// Crash if we don't find a document, we're already in a bad state.
var document = this.SubjectBuffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges();
Contract.ThrowIfNull(document, nameof(document));
return document;
}
private CompletionHelper GetCompletionHelper()
{
// Crash if we don't find a document, we're already in a bad state.
var document = GetDocument();
return CompletionHelper.GetHelper(document);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册