We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2393a19 commit 8556775Copy full SHA for 8556775
lib/notifications/display.dart
@@ -1,4 +1,5 @@
1
import 'dart:convert';
2
+import 'dart:io';
3
4
import 'package:http/http.dart' as http;
5
import 'package:collection/collection.dart';
@@ -281,10 +282,13 @@ class NotificationDisplayManager {
281
282
try {
283
// TODO timeout to prevent waiting indefinitely
284
final resp = await http.get(url);
- return resp.bodyBytes;
285
+ final bodyBytes = resp.bodyBytes;
286
+ if (resp.statusCode == HttpStatus.ok) {
287
+ return bodyBytes;
288
+ }
289
} catch (e) {
290
// TODO(log)
- return null;
291
}
292
+ return null;
293
294
0 commit comments