add some null checks to checking if primary color changed

This commit is contained in:
tibbi 2017-05-14 20:43:03 +02:00
parent 87b722bac3
commit 55f6f934ff
2 changed files with 2 additions and 2 deletions

View file

@ -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()
}

View file

@ -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()
}