Additional fix for #890. http_utils.dart migrated to null safety
diff --git a/LibTest/io/http_utils.dart b/LibTest/io/http_utils.dart
index b36161c..b74ac37 100644
--- a/LibTest/io/http_utils.dart
+++ b/LibTest/io/http_utils.dart
@@ -54,10 +54,10 @@
});
}
-List<int> _bigData = null;
+List<int> _bigData = [];
List<int> get bigData {
- if (_bigData == null) {
+ if (_bigData.isEmpty) {
_bigData = getList(8187);
}
return _bigData;
@@ -135,14 +135,17 @@
}
Future<List<List<int>>> receiveDatagram(RawDatagramSocket receiver,
- {Duration delay = const Duration(seconds: 2), RawSocketEvent event}) {
+ {Duration delay = const Duration(seconds: 2), RawSocketEvent? event}) {
List<List<int>> received = [];
Completer<List<List<int>>> completer = new Completer<List<List<int>>>();
Future<List<List<int>>> f = completer.future;
receiver.listen((_event) {
var datagram = receiver.receive();
if (event == null || _event == event) {
- received.add(datagram?.data);
+ var d = datagram?.data.toList();
+ if (d != null) {
+ received.add(d);
+ }
}
if (_event == RawSocketEvent.closed) {
if(!completer.isCompleted) {