From 711736cbeb3ca5cbc4a6f4e19d66ab5577cbafc0 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 19 Sep 2016 22:18:19 +0200 Subject: [PATCH] add a null check to dayfragment --- .../com/simplemobiletools/calendar/fragments/DayFragment.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/fragments/DayFragment.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/fragments/DayFragment.kt index 5a1d854b4..f762d261b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/fragments/DayFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/fragments/DayFragment.kt @@ -124,6 +124,9 @@ class DayFragment : Fragment(), DBHelper.DBOperationsListener, AdapterView.OnIte private fun updateEvents(events: MutableList) { mEvents = ArrayList(events) val eventsToShow = getEventsToShow(events) + if (activity == null) + return + val eventsAdapter = EventsAdapter(activity.baseContext, eventsToShow) mHolder.day_events.apply { adapter = eventsAdapter