Setting null as the default value for a member with a nullable type with UseDefaultOnConversionFailure set to true will not use that default value when a conversion failure occurs, but throws a TypeConverterException instead. This is unintuitive behavior and seems like a bug.
This code fixes the type comparison when the default value is set to null so that the code behaves like one would expect.
Setting
null
as the default value for a member with a nullable type withUseDefaultOnConversionFailure
set totrue
will not use that default value when a conversion failure occurs, but throws aTypeConverterException
instead. This is unintuitive behavior and seems like a bug.This code fixes the type comparison when the default value is set to
null
so that the code behaves like one would expect.discussion