Skip to content

Commit 3ef03d9

Browse files
committed
Add Guard
1 parent 05744ed commit 3ef03d9

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/SharpIDE.Application/Features/Analysis/RoslynAnalysis.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,6 +1019,7 @@ private static Project GetProjectForSharpIdeFile(SharpIdeFile sharpIdeFile)
10191019

10201020
private static Project GetProjectForSharpIdeProjectModel(SharpIdeProjectModel projectModel)
10211021
{
1022+
Guard.Against.Null(projectModel);
10221023
var projectsForProjectPath = _workspace!.CurrentSolution.Projects.Where(s => s.FilePath == projectModel.FilePath).ToList();
10231024
if (projectsForProjectPath.Count is 0) throw new InvalidOperationException($"No project found in workspace for project path '{projectModel.FilePath}'");
10241025
if (projectsForProjectPath.Count is 1)

0 commit comments

Comments
 (0)