ub3lal há 1 mês atrás
pai
commit
abfec7ace3
1 ficheiros alterados com 6 adições e 0 exclusões
  1. 6 0
      lib/src/http_request.dart

+ 6 - 0
lib/src/http_request.dart

@@ -65,7 +65,13 @@ class HttpGetImage {
         response = await http
             .get(Uri.parse(url), headers: headers)
             .timeout(Duration(seconds: time));
+
         if (response.statusCode == 200) {
+          if (response.body.isNotEmpty) {
+            sendPort.send(null);
+            break;
+          }
+
           sendPort.send(response.bodyBytes);
           break;
         }