Skip to content

Commit 14b48c2

Browse files
authored
Merge pull request #240 from samuelstroschein/master
gql_websocket_link: better (correct) assertion
2 parents 79735f5 + 41714f0 commit 14b48c2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

links/gql_websocket_link/lib/src/link.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ class WebSocketLink extends Link {
120120
this.graphQLSocketMessageDecoder = _defaultGraphQLSocketMessageDecoder,
121121
this.initialPayload,
122122
this.inactivityTimeout,
123-
}) : assert(uri == null || (channelGenerator == null)) {
123+
}) : assert((uri == null && channelGenerator != null) ||
124+
(uri != null && channelGenerator == null)) {
124125
_channelGenerator =
125126
channelGenerator ?? () => WebSocketChannel.connect(Uri.parse(uri!));
126127
}

0 commit comments

Comments
 (0)