Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite432d6b

Browse files
forkiKevinRansom
authored andcommitted
null check in project system (dotnet#2248)
* null check in project system* Fix hierarchy null exceptionConflicts:vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectReferenceNode.cs
1 parent0eb04a4 commite432d6b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

‎vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectReferenceNode.cs‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -832,6 +832,9 @@ private static FrameworkCompatibility CheckFrameworksCompatibility(ProjectNode t
832832
{
833833
// copying logic from C#'s project system, langref.cpp: IsProjectReferenceReferenceable()
834834
varotherFrameworkName=GetProjectTargetFrameworkName(thisProject.Site,referencedProjectGuid);
835+
if(otherFrameworkName==null)
836+
returnFrameworkCompatibility.Ok;
837+
835838
if(String.Compare(otherFrameworkName.Identifier,".NETPortable",StringComparison.OrdinalIgnoreCase)==0)
836839
{
837840
// we always allow references to projects that are targeted to the Portable/".NETPortable" fx family
@@ -865,7 +868,11 @@ private static FrameworkCompatibility CheckFrameworksCompatibility(ProjectNode t
865868
privatestaticSystem.Runtime.Versioning.FrameworkNameGetProjectTargetFrameworkName(System.IServiceProviderserviceProvider,GuidreferencedProjectGuid)
866869
{
867870
varhierarchy=VsShellUtilities.GetHierarchy(serviceProvider,referencedProjectGuid);
871+
if(hierarchy==null)
872+
returnnull;
873+
868874
objectotherTargetFrameworkMonikerObj;
875+
869876
hierarchy.GetProperty(VSConstants.VSITEMID_ROOT,(int)__VSHPROPID4.VSHPROPID_TargetFrameworkMoniker,outotherTargetFrameworkMonikerObj);
870877

871878
stringtargetFrameworkMoniker=(string)otherTargetFrameworkMonikerObj;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp