Skip to content

Commit 1003c4b

Browse files
committed
fix(graphql): remove unnecessary null checks in SocketClient
**Fixes** - Removed unnecessary null checks(!) on SocketChannel instance in SocketClient onConnectionLost() method which cause an error when client cannot connect (#1379). this prevents reconnecting when there is a working connection later.
1 parent eebac38 commit 1003c4b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/graphql/lib/src/links/websocket_link/websocket_client.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,8 +372,8 @@ class SocketClient {
372372
}
373373

374374
void onConnectionLost([Object? e]) async {
375-
var code = socketChannel!.closeCode;
376-
var reason = socketChannel!.closeReason;
375+
var code = socketChannel?.closeCode;
376+
var reason = socketChannel?.closeReason;
377377

378378
await _closeSocketChannel();
379379
if (e != null) {

0 commit comments

Comments
 (0)