Use ifBlank
This commit is contained in:
parent
17ba764518
commit
d844cafa2c
@ -88,11 +88,9 @@ object DistributorUtils {
|
|||||||
private fun getApp(context: Context, connectorToken: String): String? {
|
private fun getApp(context: Context, connectorToken: String): String? {
|
||||||
val db = getDb(context)
|
val db = getDb(context)
|
||||||
val app = db.getPackageName(connectorToken)
|
val app = db.getPackageName(connectorToken)
|
||||||
return if (app.isBlank()) {
|
return app.ifBlank {
|
||||||
Log.w(TAG, "No app found for this token")
|
Log.w(TAG, "No app found for this token")
|
||||||
null
|
null
|
||||||
} else {
|
|
||||||
app
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user