Fix infinite pending link preview on large previews.
This commit is contained in:
parent
8c35628863
commit
767896b14c
1 changed files with 9 additions and 1 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Reference in a new issue