Fix multiple exception crash in rx message send flow.

This commit is contained in:
Cody Henthorne 2024-04-01 14:27:11 -04:00 committed by Greyson Parrelli
parent 08a407dc23
commit 133b7ef3f1

View file

@ -158,6 +158,7 @@ import javax.annotation.Nullable;
import io.reactivex.rxjava3.core.Observable;
import io.reactivex.rxjava3.core.Scheduler;
import io.reactivex.rxjava3.core.Single;
import io.reactivex.rxjava3.exceptions.CompositeException;
import io.reactivex.rxjava3.schedulers.Schedulers;
import kotlin.Unit;
import okio.ByteString;
@ -2164,7 +2165,9 @@ public class SignalServiceMessageSender {
.lastOrError()
.blockingGet();
} catch (RuntimeException e) {
Throwable cause = e.getCause();
Throwable cause = e instanceof CompositeException ? ((CompositeException) e).getExceptions().get(0)
: e.getCause();
if (cause instanceof IOException) {
throw (IOException) cause;
} else if (cause instanceof InterruptedException) {