-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Description
Thanks for a great plugin! Occasionally I'm seeing the following crash stack trace in my app log when calling GetCalendarsAsync on Android:
Xamarin Exception Stack:
System.NullReferenceException: Object reference not set to an instance of an object
at Plugin.Calendars.CalendarsImplementation.IterateCursor[T] (Android.Database.ICursor cursor, System.Func`1[TResult] func) <0x7504be4200 + 0x00160> in <66a7b4e231214800b78812276a0f1b58>:0
at Plugin.Calendars.CalendarsImplementation+<>c.<GetCalendarsAsync>b__13_0 () <0x7504bdd894 + 0x000d3> in <66a7b4e231214800b78812276a0f1b58>:0
Just had a look at the implementation of GetCalendarsAsync for Android:
| public Task<IList<Calendar>> GetCalendarsAsync() => Task.Run(() => | |
| { | |
| var cursor = Query(_calendarsUri, _calendarsProjection); | |
| var calendars = IterateCursor(cursor, () => GetCalendar(cursor)); | |
| return calendars; | |
| }); |
It seems that on some devices when certain conditions are met the cursor query on line 81 returns null. At least that's how I interpret the stack trace.
Im thinking a null check on the cursor variable might fix this?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels