From 6437970df8c2c80c7d1bb06850b7d2327c006d40 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 1 Jul 2018 11:56:23 +0200 Subject: [PATCH] fixing a crash at changing the column count --- .../com/simplemobiletools/gallery/activities/MainActivity.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt index f04462378..bb02480c3 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -534,7 +534,9 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { private fun columnCountChanged() { invalidateOptionsMenu() directories_grid.adapter?.notifyDataSetChanged() - measureRecyclerViewContent(getRecyclerAdapter()!!.dirs) + getRecyclerAdapter()?.dirs?.apply { + measureRecyclerViewContent() + } } private fun isPickImageIntent(intent: Intent) = isPickIntent(intent) && (hasImageContentData(intent) || isImageType(intent))