mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-24 21:15:48 +00:00
Fix BackupSubscriptionCheckJob tests.
This commit is contained in:
@@ -246,6 +246,16 @@ sealed class NetworkResult<T>(
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the result if successful, otherwise null.
|
||||
*/
|
||||
fun successOrNull(): T? {
|
||||
return when (this) {
|
||||
is Success -> result
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the [Throwable] associated with the result, or null if the result is successful.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user