move the null check at getSharedTheme cursor

This commit is contained in:
tibbi 2017-12-04 16:38:44 +01:00
parent c4b6502dae
commit 460e996a83

View file

@ -275,8 +275,8 @@ fun Context.getSharedTheme(callback: (sharedTheme: SharedTheme?) -> Unit) {
Thread {
val cursor = cursorLoader.loadInBackground()
cursor.use {
if (cursor?.moveToFirst() == true) {
cursor?.use {
if (cursor.moveToFirst()) {
val textColor = cursor.getIntValue(COL_TEXT_COLOR)
val backgroundColor = cursor.getIntValue(COL_BACKGROUND_COLOR)
val primaryColor = cursor.getIntValue(COL_PRIMARY_COLOR)