Skip to content

Commit

Permalink
Fixed #343 Empty query map in OptionsBuilder throws RangeError
Browse files Browse the repository at this point in the history
  • Loading branch information
jumperchen committed Feb 17, 2024
1 parent e2e1a0e commit 99e93dd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* [#55](https://github.com/rikulo/socket.io-client-dart/issues/55) how to custom parser
* [#322](https://github.com/rikulo/socket.io-client-dart/pull/322) added emitWithAckAsync
* [#334](https://github.com/rikulo/socket.io-client-dart/pull/334) Socket.on... returns disposer function
* [#343](https://github.com/rikulo/socket.io-client-dart/issues/343) Empty query map in OptionsBuilder throws RangeError
* [#353](https://github.com/rikulo/socket.io-client-dart/issues/353) Add timeout on emit and emitWithAck

**Bug fix:**
Expand Down
3 changes: 3 additions & 0 deletions lib/src/engine/parseqs.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ String encode(Map obj) {
/// @api private
///
Map decode(qs) {
if (qs.isEmpty) {
return <dynamic, dynamic>{};
}
var qry = <dynamic, dynamic>{};
var pairs = qs.split('&');
for (var i = 0, l = pairs.length; i < l; i++) {
Expand Down
2 changes: 1 addition & 1 deletion lib/src/socket.dart
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ class Socket extends EventEmitter {

for (var packet in sendBuffer) {
notifyOutgoingListeners(packet);
packet(packet);
this.packet(packet);
}
sendBuffer = [];
}
Expand Down

0 comments on commit 99e93dd

Please sign in to comment.