Skip to content

Commit b6ba32d

Browse files
author
Adrián García
committed
Fix getOrNull not returning value if set in Resource.loading
1 parent 8ed51dd commit b6ba32d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

mini-common/src/main/java/mini/Resource.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ open class Resource<out T> @PublishedApi internal constructor(val value: Any?) {
3535
*/
3636
fun getOrNull(): T? =
3737
when {
38+
isLoading -> (value as Loading<T>).value
3839
isSuccess -> value as T?
3940
else -> null
4041
}

0 commit comments

Comments
 (0)