Skip to content

Commit

Permalink
Added null.
Browse files Browse the repository at this point in the history
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
  • Loading branch information
askpt committed Jul 5, 2024
1 parent 9168dbc commit 94e7ae6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/OpenFeature/Api.cs
Original file line number Diff line number Diff line change
Expand Up @@ -286,14 +286,14 @@ private async Task AfterInitialization(FeatureProvider provider)
/// <summary>
/// Update the provider state to ERROR and emit an ERROR after failed init.
/// </summary>
private async Task AfterError(FeatureProvider provider, Exception ex)
private async Task AfterError(FeatureProvider provider, Exception? ex)

{
provider.Status = typeof(ProviderFatalException) == ex.GetType() ? ProviderStatus.Fatal : ProviderStatus.Error;
provider.Status = typeof(ProviderFatalException) == ex?.GetType() ? ProviderStatus.Fatal : ProviderStatus.Error;
var eventPayload = new ProviderEventPayload
{
Type = ProviderEventTypes.ProviderError,
Message = $"Provider initialization error: {ex.Message}",
Message = $"Provider initialization error: {ex?.Message}",
ProviderName = provider.GetMetadata().Name,
};

Expand Down

0 comments on commit 94e7ae6

Please sign in to comment.