diff --git a/net-core/Ical.Net/Serialization/DataTypes/RecurrencePatternSerializer.cs b/net-core/Ical.Net/Serialization/DataTypes/RecurrencePatternSerializer.cs index 5bb506f38..18e4a3968 100644 --- a/net-core/Ical.Net/Serialization/DataTypes/RecurrencePatternSerializer.cs +++ b/net-core/Ical.Net/Serialization/DataTypes/RecurrencePatternSerializer.cs @@ -75,6 +75,14 @@ public virtual void CheckMutuallyExclusive(string name1, string name2, T { return; } + + // For some reason GetField("MinValue") sometimes returns 'null' when the obj is an int + // Casting the object to an int and directly checking for MinValue works though. + if (obj1 is int c && c == int.MinValue) + { + return; + } + // If the object is MinValue instead of its default, consider // that to be unassigned.