Added Boolean extension functions

This commit is contained in:
Adolfo Santiago 2021-11-21 18:18:10 +01:00
parent 76b2c95e8c
commit b37bb78298
No known key found for this signature in database
GPG Key ID: 244D6F9A317B4A65
1 changed files with 10 additions and 0 deletions

View File

@ -0,0 +1,10 @@
package com.keylesspalace.tusky.core.extensions
/**
* Returns false if a Boolean is null.
*
* @return False if null, the value otherwise.
*/
fun Boolean?.orEmpty(): Boolean {
return (this ?: false)
}