Skip to content

Commit

Permalink
Resolve: error is throwed from graphql package (althought it doesn't …
Browse files Browse the repository at this point in the history
…make any crash) when toggleConnection != null.

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: ValueStream has no value. You should check ValueStream.hasValue before accessing ValueStream.value, or use ValueStream.valueOrNull instead.
      BehaviorSubject.value (package:rxdart/src/subjects/behavior_subject.dart:146:5)
      SocketClient._listenToToggleConnection.<anonymous closure> (package:graphql/src/links/websocket_link/websocket_client.dart:264:40)
      _RootZone.runUnaryGuarded (dart:async/zone.dart:1594:10)
      _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
      _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
      _MultiStreamController.addSync (dart:async/stream_impl.dart:1101:36)
      _MultiControllerSink.add (package:rxdart/src/utils/forwarding_stream.dart:130:35)
      _TakeUntilStreamSink.onData (package:rxdart/src/transformers/take_until.dart:13:31)
  • Loading branch information
hantrungkien committed May 27, 2024
1 parent c0621cc commit 2e919b4
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,8 @@ class SocketClient {
final SocketClientConfig config;

final BehaviorSubject<SocketConnectionState> _connectionStateController =
BehaviorSubject<SocketConnectionState>();
BehaviorSubject<SocketConnectionState>.seeded(
SocketConnectionState.notConnected);

final HashMap<String, SubscriptionListener> _subscriptionInitializers =
HashMap();
Expand Down

0 comments on commit 2e919b4

Please sign in to comment.