mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-22 01:40:07 +01:00
Fix infinite pending link preview on large previews.
This commit is contained in:
committed by
Greyson Parrelli
parent
8c35628863
commit
767896b14c
@@ -190,7 +190,15 @@ public class LinkPreviewRepository {
|
||||
return;
|
||||
}
|
||||
|
||||
String body = OkHttpUtil.readAsString(response.body(), FAILSAFE_MAX_TEXT_SIZE);
|
||||
String body;
|
||||
try {
|
||||
body = OkHttpUtil.readAsString(response.body(), FAILSAFE_MAX_TEXT_SIZE);
|
||||
} catch (IOException e) {
|
||||
Log.w(TAG, "Failed to read body", e);
|
||||
callback.accept(Metadata.empty());
|
||||
return;
|
||||
}
|
||||
|
||||
OpenGraph openGraph = LinkPreviewUtil.parseOpenGraphFields(body);
|
||||
Optional<String> title = openGraph.getTitle();
|
||||
Optional<String> description = openGraph.getDescription();
|
||||
|
||||
Reference in New Issue
Block a user