Skip to content

Commit

Permalink
fix: Fix bug if inner sub set is empty causing NPE (#48)
Browse files Browse the repository at this point in the history
* Fix bug if inner sub set is empty causing NPE [tentative]

(I haven't tried but I think this might be the issue)

* Update lib/ordered_set.dart
  • Loading branch information
luanpotter authored Oct 20, 2024
1 parent 6a938a2 commit 17709ad
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/ordered_set.dart
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,12 @@ class _OrderedSetIterator<E> implements Iterator<E> {
if (_innerIterator?.moveNext() != true) {
final result = _iterator.moveNext();

if (result) {
_innerIterator = _iterator.current.iterator..moveNext();
if (!result) {
return false;
}

return result;
_innerIterator = _iterator.current.iterator;
return _innerIterator!.moveNext();
}
return true;
}
Expand Down

0 comments on commit 17709ad

Please sign in to comment.