Skip to content

Commit 4eee945

Browse files
Neplexgabber235
authored andcommitted
fix: force default WebSocket port to prevent :0 error when port is missing
1 parent c4b2066 commit 4eee945

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/lib/models/communicator.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ class SocketNotifier extends StateNotifier<Socket?> {
112112
return;
113113
}
114114

115-
var socketPort = (port == null || port == 0) ? (secure ? 443 : 80) : port;
116-
var scheme = secure ? "wss" : "ws";
115+
final int socketPort = (port == null || port == 0) ? (secure ? 443 : 80) : port!;
116+
final scheme = secure ? 'wss' : 'ws';
117117
var url = "$scheme://$hostname:$socketPort";
118118
if (token != null) url += "?token=$token";
119119

0 commit comments

Comments
 (0)