additional http status code check

This commit is contained in:
Fabian Freund
2024-06-12 14:18:52 +02:00
parent 5338e7adbe
commit 22bf859ee0
2 changed files with 8 additions and 4 deletions
+7 -3
View File
@@ -82,9 +82,13 @@ class GenericWebsiteService extends _$GenericWebsiteService {
(result) => result.flatMapAsync(
(info) async {
if (info.favicon != null) {
return _client
.get(info.favicon!.url)
.then((response) => response.bodyBytes);
return _client.get(info.favicon!.url).then((response) {
if (response.statusCode == 200) {
return response.bodyBytes;
} else {
return null;
}
});
}
return null;