File tree Expand file tree Collapse file tree 1 file changed +7
-11
lines changed
Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -30,25 +30,21 @@ public void Execute(GeneratorExecutionContext context)
3030 return ;
3131 }
3232
33- GeneratorOptions ? options = null ;
3433 var gitBuildInfoJsonFile = context . AdditionalFiles
3534 . FirstOrDefault ( af => string . Equals ( Path . GetFileName ( af . Path ) , "GitBuildInfo.json" , StringComparison . OrdinalIgnoreCase ) ) ;
36- if ( gitBuildInfoJsonFile is object )
35+ if ( gitBuildInfoJsonFile is null )
3736 {
38- var optionsJson = gitBuildInfoJsonFile . GetText ( context . CancellationToken ) ! . ToString ( ) ;
39- options = JsonSerializer . Deserialize < GeneratorOptions > ( optionsJson , new JsonSerializerOptions
37+ return ;
38+ }
39+
40+ var options = JsonSerializer . Deserialize < GeneratorOptions > (
41+ gitBuildInfoJsonFile . GetText ( context . CancellationToken ) ! . ToString ( ) ,
42+ new JsonSerializerOptions
4043 {
4144 AllowTrailingCommas = true ,
4245 ReadCommentHandling = JsonCommentHandling . Skip ,
4346 PropertyNamingPolicy = JsonNamingPolicy . CamelCase ,
4447 } ) ;
45- }
46-
47- if ( options is null || gitBuildInfoJsonFile is null )
48- {
49- return ;
50- }
51-
5248 if ( string . IsNullOrEmpty ( options . AssemblyType ) )
5349 {
5450 throw new GenerationFailedException ( "AssemblyType should not be null or an empty string." ) ;
You can’t perform that action at this time.
0 commit comments