Skip to content

Commit

Permalink
Merge pull request #797 from DustinCampbell/fix-null-ref-in-dotnet
Browse files Browse the repository at this point in the history
Fix null reference in DotNetProjectSystem when project reference is invalid
  • Loading branch information
filipw authored Mar 14, 2017
2 parents 68bb994 + 828139c commit 8e229db
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/OmniSharp.DotNet/DotNetProjectSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,17 @@ private void UpdateProjectReferences(ProjectState state, IEnumerable<ProjectDesc
}

var referencedProjectState = _projectStates.Find(projectPath, description.Framework);
projectReferences.Add(new ProjectReference(referencedProjectState.Id));
state.ProjectReferences[projectPath] = referencedProjectState.Id;
if (referencedProjectState != null)
{
projectReferences.Add(new ProjectReference(referencedProjectState.Id));
state.ProjectReferences[projectPath] = referencedProjectState.Id;

_logger.LogDebug($" Add project reference {description.Path}");
_logger.LogDebug($" Add project reference {description.Path}");
}
else
{
_logger.LogError($" Could not find project reference {description.Path}");
}
}

foreach (var reference in projectReferences)
Expand Down

0 comments on commit 8e229db

Please sign in to comment.