Skip to content

Commit b8f4284

Browse files
committed
Also handle the possible null calendar id arrays in ToString
1 parent 11080c7 commit b8f4284

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Cronofy/AvailabilityRule.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,11 @@ public bool Equals(AvailabilityRule other)
8787
public override string ToString()
8888
{
8989
return string.Format(
90-
"<{0} AvailabilityRuleId={1}, TimeZoneId={2}, CalendarIds={3}, WeeklyPeriods={4}>",
90+
"<{0} AvailabilityRuleId={1}, TimeZoneId={2}, CalendarIds={3}, WeeklyPeriods=[{4}]>",
9191
this.GetType(),
9292
this.AvailabilityRuleId,
9393
this.TimeZoneId,
94-
this.CalendarIds,
94+
this.CalendarIds == null ? "null" : string.Format("[{0}]", string.Join(", ", this.CalendarIds)),
9595
string.Join(", ", this.WeeklyPeriods.Select(weeklyPeriod => weeklyPeriod.ToString())));
9696
}
9797

0 commit comments

Comments
 (0)