From 681dc87b67a721c418a7c19f25d3d0349825eddb Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 19 Feb 2017 23:39:36 +0100 Subject: [PATCH] adding a crashfix to week fragment --- .../com/simplemobiletools/calendar/fragments/WeekFragment.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/fragments/WeekFragment.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/fragments/WeekFragment.kt index 29954e834..02ec34d7a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/fragments/WeekFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/fragments/WeekFragment.kt @@ -319,6 +319,9 @@ class WeekFragment : Fragment(), WeeklyCalendar { val daysCnt = Days.daysBetween(Formatter.getDateTimeFromTS(minTS), Formatter.getDateTimeFromTS(maxTS)).days activity.runOnUiThread { + if (activity == null) + return@runOnUiThread + mView.week_all_day_holder.addView(this) (layoutParams as LinearLayout.LayoutParams).apply { topMargin = mRes.getDimension(R.dimen.tiny_margin).toInt()