diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/asynctasks/FetchGoogleEventsTask.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/asynctasks/FetchGoogleEventsTask.kt index 3e3a89b85..1542ca0d3 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/asynctasks/FetchGoogleEventsTask.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/asynctasks/FetchGoogleEventsTask.kt @@ -190,14 +190,16 @@ class FetchGoogleEventsTask(val context: Context, val googleSyncListener: Google } } - private fun getReminders(json: JsonObject): List { - val array = json.getAsJsonArray(OVERRIDES) - val token = object : TypeToken>() {}.type - val reminders = Gson().fromJson>(array, token) ?: ArrayList(2) + private fun getReminders(json: JsonObject?): List { val reminderMinutes = ArrayList() - for ((method, minutes) in reminders) { - if (method == POPUP) { - reminderMinutes.add(minutes) + if (json?.has(OVERRIDES) == true) { + val array = json.getAsJsonArray(OVERRIDES) + val token = object : TypeToken>() {}.type + val reminders = Gson().fromJson>(array, token) ?: ArrayList(2) + for ((method, minutes) in reminders) { + if (method == POPUP) { + reminderMinutes.add(minutes) + } } } return reminderMinutes