File tree Expand file tree Collapse file tree 2 files changed +3
-9
lines changed
src/Smdn.Reflection.ReverseGenerating.ListApi
Smdn.Reflection.ReverseGenerating.ListApi.Build
Smdn.Reflection.ReverseGenerating.ListApi Expand file tree Collapse file tree 2 files changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -83,11 +83,7 @@ private static string GetMSBuildExePath(out string? sdkVersion)
8383#if true
8484 sdkVersion = default ;
8585
86- var sdkBasePath = GetSdkBasePath ( out sdkVersion ) ;
87-
88- if ( sdkBasePath is null )
89- throw new InvalidOperationException( "could not get SDK base path" ) ;
90-
86+ var sdkBasePath = GetSdkBasePath ( out sdkVersion ) ?? throw new InvalidOperationException ( "could not get SDK base path" ) ;
9187 var msbuildExePath = JoinPath (
9288 sdkBasePath ,
9389 "MSBuild.dll" // .NET SDK always ships MSBuild executables with the extension 'dll'
Original file line number Diff line number Diff line change @@ -32,10 +32,8 @@ public static FileInfo FindSingleProjectOrSolution(
3232 if ( 1 < solutionAndProjectFiles . Count ( ) )
3333 throw new InvalidOperationException ( $ "multiple solution or project file found in directory '{ directory . FullName } '") ;
3434
35- var first = solutionAndProjectFiles . FirstOrDefault ( ) ;
36-
37- if ( first is null )
38- throw new FileNotFoundException ( $ "no solution or project file found in directory '{ directory . FullName } '") ;
35+ var first = solutionAndProjectFiles . FirstOrDefault ( )
36+ ?? throw new FileNotFoundException ( $ "no solution or project file found in directory '{ directory . FullName } '") ;
3937
4038 logger ? . LogDebug ( "found '{ProjectOrSolutionPath}'" , first . FullName ) ;
4139
You can’t perform that action at this time.
0 commit comments