Skip to content

Commit

Permalink
Fix error around mapping Nullable<JsonElement> (npgsql#3353)
Browse files Browse the repository at this point in the history
  • Loading branch information
roji authored and WhatzGames committed Dec 18, 2024
1 parent aa14a0d commit df5469b
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public void ProcessPropertyAdded(IConventionPropertyBuilder propertyBuilder, ICo
{
var property = propertyBuilder.Metadata;

if (property.ClrType == typeof(JsonElement) && property.GetColumnType() is null)
if (property.ClrType.UnwrapNullableType() == typeof(JsonElement) && property.GetColumnType() is null)
{
property.SetTypeMapping(_jsonTypeMapping ??= new NpgsqlJsonTypeMapping("jsonb", typeof(JsonElement)));
}
Expand Down

0 comments on commit df5469b

Please sign in to comment.