Skip to content

Commit

Permalink
Rule out KeyValuePair targets in ExtractPropertyValueConverter.
Browse files Browse the repository at this point in the history
  • Loading branch information
danielcweber committed Jan 11, 2025
1 parent 9c41d20 commit 960b354
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public bool TryConvert(JToken serialized, ITransformer defer, ITransformer recur
}
}

public IConverter<TSource, TTarget>? TryCreate<TSource, TTarget>(IGremlinQueryEnvironment environment) => typeof(JToken).IsAssignableFrom(typeof(TSource))
public IConverter<TSource, TTarget>? TryCreate<TSource, TTarget>(IGremlinQueryEnvironment environment) => typeof(JToken).IsAssignableFrom(typeof(TSource)) && !(typeof(TTarget).IsGenericType && typeof(TTarget).GetGenericTypeDefinition() == typeof(KeyValuePair<,>))
? (IConverter<TSource, TTarget>)(object)new ExtractPropertyValueConverter<TTarget>(environment)
: default;
}
Expand Down

0 comments on commit 960b354

Please sign in to comment.