diff --git a/owncloudDomain/src/main/java/com/owncloud/android/domain/UseCaseResult.kt b/owncloudDomain/src/main/java/com/owncloud/android/domain/UseCaseResult.kt index 3b836ccfe17..575bc6f7b26 100644 --- a/owncloudDomain/src/main/java/com/owncloud/android/domain/UseCaseResult.kt +++ b/owncloudDomain/src/main/java/com/owncloud/android/domain/UseCaseResult.kt @@ -27,14 +27,16 @@ sealed class UseCaseResult { val isError get() = this is Error fun getDataOrNull(): T? = - when (this) { - is Success -> data - else -> null + if (this is Success) { + data + } else { + null } fun getThrowableOrNull(): Throwable? = - when (this) { - is Error -> throwable - else -> null + if (this is Error) { + throwable + } else { + null } }