Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Ical.Net/Calendar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
=> CalendarCollection.Load(new StreamReader(s, Encoding.UTF8)).SingleOrDefault();

public static Calendar? Load(TextReader tr)
=> CalendarCollection.Load(tr).SingleOrDefault();

Check warning on line 36 in Ical.Net/Calendar.cs

View check run for this annotation

Codecov / codecov/patch

Ical.Net/Calendar.cs#L36

Added line #L36 was not covered by tests

public static IList<T> Load<T>(Stream s, Encoding e)
=> Load<T>(new StreamReader(s, e));
Expand Down Expand Up @@ -241,7 +241,7 @@
// These are the UID/RECURRENCE-ID combinations that replace other occurrences.
var recurrenceIdsAndUids = this.Children.OfType<IRecurrable>()
.Where(r => r.RecurrenceId != null)
.Select(r => new { ((IUniqueComponent) r).Uid, Dt = r.RecurrenceId!.Value })
.Select(r => new { (r as IUniqueComponent).Uid, Dt = r.RecurrenceId!.Value })

Check warning on line 244 in Ical.Net/Calendar.cs

View workflow job for this annotation

GitHub Actions / coverage

Dereference of a possibly null reference.

Check warning on line 244 in Ical.Net/Calendar.cs

View workflow job for this annotation

GitHub Actions / coverage

Dereference of a possibly null reference.

Check warning on line 244 in Ical.Net/Calendar.cs

View workflow job for this annotation

GitHub Actions / tests

Dereference of a possibly null reference.

Check warning on line 244 in Ical.Net/Calendar.cs

View workflow job for this annotation

GitHub Actions / tests

Dereference of a possibly null reference.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could throw with a npe now.

.Where(r => r.Uid != null)
.ToDictionary(x => x);

Expand Down Expand Up @@ -294,7 +294,7 @@
this.AddChild(cal);
return (T) cal;
}
throw new ArgumentException($"Creating {typeof(T)} failed.");
throw new ArgumentException($"Creating {typeof(T).FullName} failed.");

Check warning on line 297 in Ical.Net/Calendar.cs

View check run for this annotation

Codecov / codecov/patch

Ical.Net/Calendar.cs#L297

Added line #L297 was not covered by tests
}

public virtual void MergeWith(IMergeable obj)
Expand Down Expand Up @@ -332,7 +332,7 @@
}
}

public virtual FreeBusy? GetFreeBusy(FreeBusy freeBusyRequest) => CalendarComponents.FreeBusy.Create(this, freeBusyRequest);

Check warning on line 335 in Ical.Net/Calendar.cs

View check run for this annotation

Codecov / codecov/patch

Ical.Net/Calendar.cs#L335

Added line #L335 was not covered by tests

public virtual FreeBusy? GetFreeBusy(CalDateTime fromInclusive, CalDateTime toExclusive)
=> CalendarComponents.FreeBusy.Create(this, CalendarComponents.FreeBusy.CreateRequest(fromInclusive, toExclusive, null, null));
Expand Down
4 changes: 2 additions & 2 deletions Ical.Net/CalendarCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,20 +71,20 @@

public FreeBusy? GetFreeBusy(FreeBusy freeBusyRequest)
{
return this.Aggregate<Calendar, FreeBusy?>(null, (current, iCal) =>
{
var freeBusy = iCal.GetFreeBusy(freeBusyRequest);

Check warning on line 76 in Ical.Net/CalendarCollection.cs

View check run for this annotation

Codecov / codecov/patch

Ical.Net/CalendarCollection.cs#L74-L76

Added lines #L74 - L76 were not covered by tests
return current is null ? freeBusy : CombineFreeBusy(current, freeBusy!);
return current is null ? freeBusy : CombineFreeBusy(current, freeBusy);

Check warning on line 77 in Ical.Net/CalendarCollection.cs

View workflow job for this annotation

GitHub Actions / coverage

Possible null reference argument for parameter 'current' in 'FreeBusy CalendarCollection.CombineFreeBusy(FreeBusy? main, FreeBusy current)'.

Check warning on line 77 in Ical.Net/CalendarCollection.cs

View workflow job for this annotation

GitHub Actions / coverage

Possible null reference argument for parameter 'current' in 'FreeBusy CalendarCollection.CombineFreeBusy(FreeBusy? main, FreeBusy current)'.

Check warning on line 77 in Ical.Net/CalendarCollection.cs

View workflow job for this annotation

GitHub Actions / tests

Possible null reference argument for parameter 'current' in 'FreeBusy CalendarCollection.CombineFreeBusy(FreeBusy? main, FreeBusy current)'.

Check warning on line 77 in Ical.Net/CalendarCollection.cs

View workflow job for this annotation

GitHub Actions / tests

Possible null reference argument for parameter 'current' in 'FreeBusy CalendarCollection.CombineFreeBusy(FreeBusy? main, FreeBusy current)'.
});

Check warning on line 78 in Ical.Net/CalendarCollection.cs

View check run for this annotation

Codecov / codecov/patch

Ical.Net/CalendarCollection.cs#L78

Added line #L78 was not covered by tests
}

public FreeBusy? GetFreeBusy(Organizer organizer, IEnumerable<Attendee> contacts, CalDateTime fromInclusive, CalDateTime toExclusive)
{
return this.Aggregate<Calendar, FreeBusy?>(null, (current, iCal) =>
{
var freeBusy = iCal.GetFreeBusy(organizer, contacts, fromInclusive, toExclusive);

Check warning on line 85 in Ical.Net/CalendarCollection.cs

View check run for this annotation

Codecov / codecov/patch

Ical.Net/CalendarCollection.cs#L83-L85

Added lines #L83 - L85 were not covered by tests
return current is null ? freeBusy : CombineFreeBusy(current, freeBusy!);
return current is null ? freeBusy : CombineFreeBusy(current, freeBusy);

Check warning on line 86 in Ical.Net/CalendarCollection.cs

View workflow job for this annotation

GitHub Actions / coverage

Possible null reference argument for parameter 'current' in 'FreeBusy CalendarCollection.CombineFreeBusy(FreeBusy? main, FreeBusy current)'.

Check warning on line 86 in Ical.Net/CalendarCollection.cs

View workflow job for this annotation

GitHub Actions / coverage

Possible null reference argument for parameter 'current' in 'FreeBusy CalendarCollection.CombineFreeBusy(FreeBusy? main, FreeBusy current)'.

Check warning on line 86 in Ical.Net/CalendarCollection.cs

View workflow job for this annotation

GitHub Actions / tests

Possible null reference argument for parameter 'current' in 'FreeBusy CalendarCollection.CombineFreeBusy(FreeBusy? main, FreeBusy current)'.

Check warning on line 86 in Ical.Net/CalendarCollection.cs

View workflow job for this annotation

GitHub Actions / tests

Possible null reference argument for parameter 'current' in 'FreeBusy CalendarCollection.CombineFreeBusy(FreeBusy? main, FreeBusy current)'.
});

Check warning on line 87 in Ical.Net/CalendarCollection.cs

View check run for this annotation

Codecov / codecov/patch

Ical.Net/CalendarCollection.cs#L87

Added line #L87 was not covered by tests
}

public override int GetHashCode() => CollectionHelpers.GetHashCode(this);
Expand Down
Loading