Merge pull request #1302 from Doflatango/fix/get_favicons_exception
Catch and ignore utf8 format exception in getFavicons()
This commit is contained in:
commit
741eb3964a
|
@ -1096,6 +1096,7 @@ class InAppWebViewController {
|
|||
}
|
||||
|
||||
if (manifestFound) {
|
||||
try {
|
||||
Map<String, dynamic> manifest =
|
||||
json.decode(await manifestResponse!.transform(Utf8Decoder()).join());
|
||||
if (manifest.containsKey("icons")) {
|
||||
|
@ -1104,6 +1105,10 @@ class InAppWebViewController {
|
|||
icon["src"], icon["rel"], icon["sizes"], true));
|
||||
}
|
||||
}
|
||||
} on FormatException catch (_) {
|
||||
/// The [manifestResponse] might not has a valid JSON string, catch and
|
||||
/// ignore the error
|
||||
}
|
||||
}
|
||||
|
||||
return favicons;
|
||||
|
|
Loading…
Reference in New Issue