Skip to content

Conversation

@MarcelaCarvalho
Copy link

This PR fixes an issue where the configuration provider throws a NullReferenceException when Vault secrets contain keys with null values. The root cause was an invalid cast of a null value to JsonElement.

The fix adds a null check and creates a JsonElement representing a JSON null (JsonValueKind.Null) when the value is null. This ensures that:

  • Keys with null values are properly included in the configuration.

  • No exceptions are thrown during configuration loading.

  • Consumers of IConfiguration can safely detect and handle keys with null values.

Issue: NullReferenceException when Vault secret contains null values in keys #70

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant