Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty query map in OptionsBuilder throws RangeError #343

Closed
jaween opened this issue Aug 21, 2023 · 0 comments
Closed

Empty query map in OptionsBuilder throws RangeError #343

jaween opened this issue Aug 21, 2023 · 0 comments
Labels

Comments

@jaween
Copy link

jaween commented Aug 21, 2023

When constructing a client with an empty query, an error is thrown.

Code sample:

final client = io(
      'http://example.com',
      OptionBuilder()
          .setTimeout(1500)
          .setTransports(['websocket'])
          .setQuery({})
          .enableForceNew()
          .build(),
    );

Notice that the query is set to {} (this happens for me when I have a conditional entry in the map).

The error that is thrown is:

[VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: RangeError (index): Invalid value: Only valid value is 0: 1
#0      List.[] (dart:core-patch/growable_array.dart:264:36)
#1      decode
parseqs.dart:35
#2      new Socket
socket.dart:100
#3      Manager.connect
manager.dart:147
#4      Manager.open
manager.dart:140
#5      Manager.reconnect.<anonymous closure>
manager.dart:411
#6      Timer._createTimer.<anonymous closure> (dart:async-patch/timer_patch.dart:18:15)
#7      _Timer._runTimers (dart:isolate-patch/timer_impl.dart:398:19)
#8      _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:429:5)
#9      _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:189:12)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants