Skip to content

Commit

Permalink
fix null check to unblock sdk (#103523)
Browse files Browse the repository at this point in the history
  • Loading branch information
kasperk81 committed Jun 17, 2024
1 parent 9df96f9 commit bcd9cb8
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,10 @@ static bool IsApplicationNameArg(string arg)
=> arg.Equals("--applicationName", StringComparison.OrdinalIgnoreCase) ||
arg.Equals("/applicationName", StringComparison.OrdinalIgnoreCase);
args = args.Any(arg => IsApplicationNameArg(arg)) || assembly?.GetName().Name is null
? args
: args.Concat(new[] { "--applicationName", assembly.GetName().Name }).ToArray();
if (!args.Any(arg => IsApplicationNameArg(arg)) && assembly.GetName().Name is string assemblyName)
{
args = args.Concat(new[] { "--applicationName", assemblyName }).ToArray();
}
var host = hostFactory(args);
return GetServiceProvider(host);
Expand Down

0 comments on commit bcd9cb8

Please sign in to comment.