Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a67a56e0 authored by Ricki Hirner's avatar Ricki Hirner
Browse files

Fix NPE in WebcalFragment

parent 787c5e48
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -247,10 +247,12 @@ class WebcalFragment: CollectionsFragment() {
                val subscriptions = mutableMapOf<HttpUrl, Long>()
                provider.query(Calendars.CONTENT_URI, arrayOf(Calendars._ID, Calendars.NAME),null, null, null)?.use { cursor ->
                    while (cursor.moveToNext())
                        HttpUrl.parse(cursor.getString(1))?.let { url ->
                        cursor.getString(1)?.let { rawName ->
                            HttpUrl.parse(rawName)?.let { url ->
                                subscriptions[url] = cursor.getLong(0)
                            }
                        }
                }

                // update "sync" field in database accordingly (will update UI)
                db.collectionDao().getByServiceAndType(serviceId, Collection.TYPE_WEBCAL).forEach { webcal ->