提交 ff46240b 编写于 作者: J Jason Malinowski

Make sure the XamlTextViewCreationListerner's RDT watcher doesn't crash

A few places we might try to remove something that we shouldn't.
上级 db62d957
......@@ -167,9 +167,12 @@ private void OnDocumentMonikerChanged(IVsHierarchy hierarchy, string oldMoniker,
private void OnDocumentClosed(uint docCookie)
{
RunningDocumentInfo info = _rdt.Value.GetDocumentInfo(docCookie);
if (_xamlProjects.TryGetValue(info.Hierarchy, out VisualStudioProject project))
if (info.Hierarchy != null && _xamlProjects.TryGetValue(info.Hierarchy, out VisualStudioProject project))
{
project.RemoveSourceFile(info.Moniker);
if (project.ContainsSourceFile(info.Moniker))
{
project.RemoveSourceFile(info.Moniker);
}
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册