Skip to content

Commit

Permalink
Fail linked preview thumbnail request instead of crashing app.
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-signal authored and greyson-signal committed Jul 21, 2021
1 parent cdcc7b6 commit 6cc0eed
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -55,6 +55,7 @@
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.IDN;
import java.util.concurrent.ExecutionException;

import okhttp3.CacheControl;
Expand Down Expand Up @@ -193,7 +194,7 @@ public void onResponse(@NonNull Call call, @NonNull Response response) throws IO
if (bitmap != null) bitmap.recycle();

callback.accept(thumbnail);
} catch (IOException e) {
} catch (IOException | IllegalArgumentException e) {
Log.w(TAG, "Exception during link preview image retrieval.", e);
controller.cancel();
callback.accept(Optional.absent());
Expand Down

0 comments on commit 6cc0eed

Please sign in to comment.