提交 376de68f 编写于 作者: K Kevin Halverson

Add null check in SemanticModelService for #load'ed trees...

上级 6eca7dcd
......@@ -485,7 +485,15 @@ private CompilationSet(VersionStamp version, ValueSource<Compilation> compilatio
}
var documentId = newProject.GetDocumentId(newTree);
Contract.Requires(documentId != null);
// GetDocumentId will return null for #load'ed trees.
// TODO: Remove this check and add logic to fetch the #load'ed tree's
// Document once https://github.com/dotnet/roslyn/issues/5260 is fixed.
if (documentId == null)
{
Debug.Assert(newProject.Solution.Workspace.Kind == "Interactive");
continue;
}
map = map.SetItem(documentId, newTree);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册