~ruther/NosSmooth

2710c1b72de24def27a94b69eaec10bd37ea7393 — Rutherther 2 years ago 5aff161
fix(packets): make nullable, optional wrapper not throw an exception for non-generic types
M Packets/NosSmooth.PacketSerializer/Converters/Common/NullableWrapperConverterFactory.cs => Packets/NosSmooth.PacketSerializer/Converters/Common/NullableWrapperConverterFactory.cs +1 -1
@@ 32,7 32,7 @@ public class NullableWrapperConverterFactory : IStringConverterFactory

    /// <inheritdoc />
    public bool ShouldHandle(Type type)
        => type.GetGenericTypeDefinition() == typeof(NullableWrapper<>);
        => type.IsGenericType && type.GetGenericTypeDefinition() == typeof(NullableWrapper<>);

    /// <inheritdoc />
    public Result<IStringConverter> CreateTypeSerializer(Type type)

M Packets/NosSmooth.PacketSerializer/Converters/Common/OptionalWrapperConverterFactory.cs => Packets/NosSmooth.PacketSerializer/Converters/Common/OptionalWrapperConverterFactory.cs +1 -1
@@ 31,7 31,7 @@ public class OptionalWrapperConverterFactory : IStringConverterFactory

    /// <inheritdoc />
    public bool ShouldHandle(Type type)
        => type.GetGenericTypeDefinition() == typeof(OptionalWrapper<>);
        => type.IsGenericType && type.GetGenericTypeDefinition() == typeof(OptionalWrapper<>);

    /// <inheritdoc />
    public Result<IStringConverter> CreateTypeSerializer(Type type)

Do not follow this link