Skip to content

Commit

Permalink
fix null check for close reason, fixes #66
Browse files Browse the repository at this point in the history
  • Loading branch information
FZambia committed Sep 16, 2022
1 parent a68ece3 commit 771634f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/src/transport.dart
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,11 @@ class Transport implements GeneratedMessageSender {
int code = connectingCodeTransportClosed;
String reason = "transport closed";
bool reconnect = true;
if (_socket != null && _socket!.closeCode! > 0) {
if (_socket != null && _socket!.closeCode != null && _socket!.closeCode! > 0) {
code = _socket!.closeCode!;
reason = _socket!.closeReason!;
if (_socket!.closeReason != null) {
reason = _socket!.closeReason!;
}
reconnect = code < 3500 || code >= 5000 || (code >= 4000 && code < 4500);
if (code < 3000) {
if (code == 1009) {
Expand Down

0 comments on commit 771634f

Please sign in to comment.