fix(ui): handle MessageInput enrichUrl exceptions.

Signed-off-by: xsahil03x <xdsahil@gmail.com>
This commit is contained in:
Sahil Kumar
2023-05-15 16:32:28 +05:30
committed by xsahil03x
parent ea451b2ff8
commit 7b01b4fe8f
@@ -1104,8 +1104,12 @@ class StreamMessageInputState extends State<StreamMessageInput>
var response = _ogAttachmentCache[url];
if (response == null) {
final client = StreamChat.of(context).client;
response = await client.enrichUrl(url);
_ogAttachmentCache[url] = response;
try {
response = await client.enrichUrl(url);
_ogAttachmentCache[url] = response;
} catch (e, stk) {
return Future.error(e, stk);
}
}
return response;
}