We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e0dadd1 commit 7203465Copy full SHA for 7203465
pkgs/cupertino_http/lib/src/cupertino_web_socket.dart
@@ -203,7 +203,13 @@ class CupertinoWebSocket implements WebSocket {
203
204
void _connectionClosed(int? closeCode, objc.NSData? reason) {
205
if (!_events.isClosed) {
206
- final closeReason = reason == null ? '' : utf8.decode(reason.toList());
+ String closeReason;
207
+
208
+ try {
209
+ closeReason = reason == null ? '' : utf8.decode(reason.toList());
210
+ } on FormatException {
211
+ closeReason = 'unknown';
212
+ }
213
214
_events
215
..add(CloseReceived(closeCode, closeReason))
0 commit comments