avoid crashing at attempting to print an empty event list view

This commit is contained in:
tibbi 2020-11-03 17:32:46 +01:00
parent c1028a46a4
commit 499cf50c4c
1 changed files with 5 additions and 0 deletions

View File

@ -230,6 +230,11 @@ class EventListFragment : MyFragmentHolder(), RefreshRecyclerViewListener {
override fun printView() {
mView.apply {
if (calendar_events_list.isGone()) {
context.toast(R.string.no_items_found)
return@apply
}
(calendar_events_list.adapter as? EventListAdapter)?.togglePrintMode()
Handler().postDelayed({
context!!.printBitmap(calendar_events_list.getViewBitmap())