Skip to content

Commit

Permalink
Fixed compile warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
AraHaan authored Mar 27, 2021
1 parent 1a2be72 commit fdf0349
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions SourceGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ public void Execute(GeneratorExecutionContext context)
ReadCommentHandling = JsonCommentHandling.Skip,
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
});
if (string.IsNullOrEmpty(options.AssemblyType))
if (string.IsNullOrEmpty(options!.AssemblyType))
{
throw new GenerationFailedException("AssemblyType should not be null or an empty string.");
}

var splitted = options.AssemblyType!.Contains(".") ? options.AssemblyType.Split('.') : new string[] { };
var splitted = options!.AssemblyType!.Contains(".") ? options!.AssemblyType.Split('.') : new string[] { };
var splittedLen = splitted.Length;
var usingStr = new StringBuilder();
var gitinformationNamespace = "Elskom.Generic.Libs";
Expand All @@ -75,8 +75,8 @@ public void Execute(GeneratorExecutionContext context)
this.RunGit("describe --all --always --dirty", Directory.GetParent(gitBuildInfoJsonFile.Path).FullName),
this.RunGit("rev-parse --short HEAD", Directory.GetParent(gitBuildInfoJsonFile.Path).FullName),
this.RunGit("name-rev --name-only HEAD", Directory.GetParent(gitBuildInfoJsonFile.Path).FullName),
splittedLen > 0 ? splitted[splittedLen - 1] : options.AssemblyType,
options.IsGeneric ? "<>" : string.Empty));
splittedLen > 0 ? splitted[splittedLen - 1] : options!.AssemblyType,
options!.IsGeneric ? "<>" : string.Empty));
}

private string RunGit(string arguments, string workingDirectory)
Expand Down

0 comments on commit fdf0349

Please sign in to comment.