Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when calling findEvent() for events without recurrence rules on iOS 16.2 #81

Open
annamaureder opened this issue Jan 20, 2023 · 0 comments

Comments

@annamaureder
Copy link

annamaureder commented Jan 20, 2023

The issues occurs on iOS 16.2 if I find an event in my calendar which does not have any recurrence rules (recurrence is an optional field when creating an event in the calendar).

from the Stacktrace:
(CoreFoundation) *** Terminating app due to uncaught exception 'NativeScript encountered a fatal error: Uncaught Error: *** -[__NSArrayI_Transfer objectAtIndex:]: index 0 beyond bounds for empty array

In the current code I found a null-check for recurrence rules which should prevent returning the first element of the array. However, on iOS 16.2 recurrence rules are empty, not null - so there comes the exception.

let recurrence: Recurrence;
  if (ekEvent.recurrenceRules !== null) {
    // just grab the first rule as we return only one anyway
    const ekRecurrenceRule: EKRecurrenceRule = ekEvent.recurrenceRules.objectAtIndex(0);

Already tested on iOS 13 and 14 - Here the recurrence rules are null, so the current check works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant