提交 9c11734b 编写于 作者: D David Poeschl

Null checks to help diagnose #1795

上级 3b370e7a
...@@ -152,8 +152,13 @@ private void InitializeOpenBuffers(SnapshotSpan triggerSpan) ...@@ -152,8 +152,13 @@ private void InitializeOpenBuffers(SnapshotSpan triggerSpan)
var document = _baseSolution.GetDocument(d); var document = _baseSolution.GetDocument(d);
SourceText text; SourceText text;
Contract.ThrowIfFalse(document.TryGetText(out text)); Contract.ThrowIfFalse(document.TryGetText(out text));
Contract.ThrowIfNull(text);
openBuffers.Add(text.FindCorrespondingEditorTextSnapshot().TextBuffer); var textSnapshot = text.FindCorrespondingEditorTextSnapshot();
Contract.ThrowIfNull(textSnapshot);
Contract.ThrowIfNull(textSnapshot.TextBuffer);
openBuffers.Add(textSnapshot.TextBuffer);
} }
foreach (var buffer in openBuffers) foreach (var buffer in openBuffers)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册