From 41714f0d31d9b7ed18346407b612344cd5e60cc2 Mon Sep 17 00:00:00 2001 From: Samuel Stroschein <35429197+samuelstroschein@users.noreply.github.com> Date: Sat, 12 Jun 2021 10:29:00 +0200 Subject: [PATCH] chore: better (correct) assertion --- links/gql_websocket_link/lib/src/link.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/links/gql_websocket_link/lib/src/link.dart b/links/gql_websocket_link/lib/src/link.dart index 4de9e5b67..6f56b0f8d 100644 --- a/links/gql_websocket_link/lib/src/link.dart +++ b/links/gql_websocket_link/lib/src/link.dart @@ -120,7 +120,8 @@ class WebSocketLink extends Link { this.graphQLSocketMessageDecoder = _defaultGraphQLSocketMessageDecoder, this.initialPayload, this.inactivityTimeout, - }) : assert(uri == null || (channelGenerator == null)) { + }) : assert((uri == null && channelGenerator != null) || + (uri != null && channelGenerator == null)) { _channelGenerator = channelGenerator ?? () => WebSocketChannel.connect(Uri.parse(uri!)); }