diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/adapters/MyDayPagerAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/adapters/MyDayPagerAdapter.kt index 9cd8e7285..19dcd1854 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/adapters/MyDayPagerAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/adapters/MyDayPagerAdapter.kt @@ -30,7 +30,7 @@ class MyDayPagerAdapter(fm: FragmentManager, private val mCodes: List, p fun checkDayEvents(pos: Int) { for (i in -1..1) { - mFragments[pos + i].checkEvents() + mFragments[pos + i]?.checkEvents() } } } diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/adapters/MyMonthPagerAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/adapters/MyMonthPagerAdapter.kt index f58ecd7bb..59634975d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/adapters/MyMonthPagerAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/adapters/MyMonthPagerAdapter.kt @@ -29,7 +29,7 @@ class MyMonthPagerAdapter(fm: FragmentManager, private val mCodes: List, fun refreshEvents(pos: Int) { for (i in -1..1) { - mFragments[pos + i].updateCalendar() + mFragments[pos + i]?.updateCalendar() } } } diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/adapters/MyWeekPagerAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/adapters/MyWeekPagerAdapter.kt index 41c0bb287..9afc7f142 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/adapters/MyWeekPagerAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/adapters/MyWeekPagerAdapter.kt @@ -27,13 +27,13 @@ class MyWeekPagerAdapter(fm: FragmentManager, val mWeekTimestamps: List, va } fun updateScrollY(pos: Int, y: Int) { - mFragments[pos - 1].updateScrollY(y) - mFragments[pos + 1].updateScrollY(y) + mFragments[pos - 1]?.updateScrollY(y) + mFragments[pos + 1]?.updateScrollY(y) } fun refreshEvents(pos: Int) { for (i in -1..1) { - mFragments[pos + i].updateEvents() + mFragments[pos + i]?.updateEvents() } } } diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/adapters/MyYearPagerAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/adapters/MyYearPagerAdapter.kt index c4c38bf1b..6741a2d1d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/adapters/MyYearPagerAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/adapters/MyYearPagerAdapter.kt @@ -29,7 +29,7 @@ class MyYearPagerAdapter(fm: FragmentManager, val mYears: List, val mListen fun refreshEvents(pos: Int) { for (i in -1..1) { - mFragments[pos + i].updateEvents() + mFragments[pos + i]?.updateEvents() } } }