From 9930ef5e6a5121d927d68da06d04db2e0551f84c Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 23 Mar 2019 09:33:51 +0100 Subject: [PATCH] properly handle null attendee name and email at caldav events --- app/build.gradle | 2 +- .../simplemobiletools/calendar/pro/helpers/CalDAVHelper.kt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 7f71d6647..975290abe 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -57,7 +57,7 @@ android { } dependencies { - implementation 'com.simplemobiletools:commons:5.10.13' + implementation 'com.simplemobiletools:commons:5.10.15' implementation 'joda-time:joda-time:2.10.1' implementation 'androidx.multidex:multidex:2.0.1' implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha3' diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/CalDAVHelper.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/CalDAVHelper.kt index 304e536da..058249827 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/CalDAVHelper.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/CalDAVHelper.kt @@ -513,8 +513,8 @@ class CalDAVHelper(val context: Context) { cursor = context.contentResolver.query(uri, projection, selection, null, null) if (cursor?.moveToFirst() == true) { do { - val name = cursor.getStringValue(CalendarContract.Attendees.ATTENDEE_NAME) - val email = cursor.getStringValue(CalendarContract.Attendees.ATTENDEE_EMAIL) + val name = cursor.getStringValue(CalendarContract.Attendees.ATTENDEE_NAME) ?: "" + val email = cursor.getStringValue(CalendarContract.Attendees.ATTENDEE_EMAIL) ?: "" val status = cursor.getIntValue(CalendarContract.Attendees.ATTENDEE_STATUS) val relationship = cursor.getIntValue(CalendarContract.Attendees.ATTENDEE_RELATIONSHIP) val attendee = Attendee(0, name, email, status, "", false, relationship)