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 a57ec49e3..0890b2812 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -194,7 +194,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { } private fun checkIfColorChanged() { - if (getRecyclerAdapter().foregroundColor != config.primaryColor) { + if (directories_grid.adapter != null && getRecyclerAdapter().foregroundColor != config.primaryColor) { getRecyclerAdapter().updatePrimaryColor(config.primaryColor) directories_fastscroller.updateHandleColor() } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt index ec6529420..554d4f80b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt @@ -107,7 +107,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { } private fun checkIfColorChanged() { - if (getRecyclerAdapter().foregroundColor != config.primaryColor) { + if (media_grid.adapter != null && getRecyclerAdapter().foregroundColor != config.primaryColor) { getRecyclerAdapter().updatePrimaryColor(config.primaryColor) media_fastscroller.updateHandleColor() }