Skip to content

Commit

Permalink
Merge pull request #27 from rafaelldi/fix-possible-nre
Browse files Browse the repository at this point in the history
Fix possible nre
  • Loading branch information
rafaelldi authored Jan 5, 2024
2 parents 17ddc45 + fdce267 commit dd8e942
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pluginGroup = me.rafaelldi.aspire
pluginName = aspire-plugin
pluginRepositoryUrl = https://github.com/rafaelldi/aspire-plugin
# SemVer format -> https://semver.org
pluginVersion = 0.2.0
pluginVersion = 0.2.1

# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
pluginSinceBuild = 233
Expand Down
2 changes: 1 addition & 1 deletion src/dotnet/aspire-session-host/Models.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ internal sealed record Session(
);

[UsedImplicitly]
internal sealed record EnvironmentVariable(string Name, string Value);
internal sealed record EnvironmentVariable(string Name, string? Value);
6 changes: 5 additions & 1 deletion src/dotnet/aspire-session-host/Sessions/SessionService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,15 @@ internal sealed class SessionService(Connection connection, ILogger<SessionServi
var id = Guid.NewGuid();
var stringId = id.ToString();
var serviceName = session.Env?.FirstOrDefault(it => it.Name == TelemetryServiceName);
var envs = session.Env
?.Where(it => it.Value is not null)
?.Select(it => new EnvironmentVariableModel(it.Name, it.Value!))
?.ToArray();
var sessionModel = new SessionModel(
stringId,
session.ProjectPath,
session.Debug,
session.Env?.Select(it => new EnvironmentVariableModel(it.Name, it.Value)).ToArray(),
envs,
session.Args,
serviceName?.Value
);
Expand Down

0 comments on commit dd8e942

Please sign in to comment.