Prevent conscrypt crash during profile retrieval.

This was a mitigation that was previously in place that was forgotten
during the recent avatar refactor.
master
Greyson Parrelli 2020-03-29 18:53:30 -04:00
parent ab600d7df1
commit f859c5b1b5
1 changed files with 5 additions and 1 deletions

View File

@ -100,7 +100,11 @@ public class RetrieveProfileAvatarJob extends BaseJob {
SignalServiceMessageReceiver receiver = ApplicationDependencies.getSignalServiceMessageReceiver();
InputStream avatarStream = receiver.retrieveProfileAvatar(profileAvatar, downloadDestination, profileKey, AvatarHelper.AVATAR_DOWNLOAD_FAILSAFE_MAX_SIZE);
AvatarHelper.setAvatar(context, recipient.getId(), avatarStream);
try {
AvatarHelper.setAvatar(context, recipient.getId(), avatarStream);
} catch (AssertionError e) {
throw new IOException("Failed to copy stream. Likely a Conscrypt issue.", e);
}
} catch (PushNetworkException e) {
if (e.getCause() instanceof NonSuccessfulResponseCodeException) {
Log.w(TAG, "Removing profile avatar (no image available) for: " + recipient.getId().serialize());