Fix NPE when there's no retryafter duration.

This commit is contained in:
Greyson Parrelli
2026-04-12 14:20:32 -04:00
parent dfd2f7baf9
commit aeeba3d2df
@@ -54,6 +54,7 @@ import java.util.concurrent.TimeUnit
import kotlin.time.Duration.Companion.days
import kotlin.time.Duration.Companion.milliseconds
import kotlin.time.Duration.Companion.minutes
import kotlin.time.toJavaDuration
/**
* Uploads an attachment without alteration.
@@ -180,7 +181,7 @@ class AttachmentUploadJob private constructor(
when (val result = SignalNetwork.attachments.getAttachmentV4UploadForm(ciphertextLength)) {
is RequestResult.Success -> result.result
is RequestResult.NonSuccess -> throw result.error
is RequestResult.RetryableNetworkError -> throw RetryLaterException(result.retryAfter)
is RequestResult.RetryableNetworkError -> throw RetryLaterException(result.retryAfter ?: defaultBackoff().milliseconds.toJavaDuration())
is RequestResult.ApplicationError -> throw result.cause
}
} else {