Added Boolean extension functions
This commit is contained in:
parent
76b2c95e8c
commit
b37bb78298
1 changed files with 10 additions and 0 deletions
|
@ -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)
|
||||
}
|
Loading…
Reference in a new issue