From 10799212d2c51916e5ac6b4351debe9074720fd8 Mon Sep 17 00:00:00 2001 From: Luan Nico Date: Thu, 17 Oct 2024 11:20:42 -0400 Subject: [PATCH 1/2] Fix bug if inner sub set is empty causing NPE [tentative] (I haven't tried but I think this might be the issue) --- lib/ordered_set.dart | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/ordered_set.dart b/lib/ordered_set.dart index e2c3104..a8d4845 100644 --- a/lib/ordered_set.dart +++ b/lib/ordered_set.dart @@ -197,11 +197,12 @@ class _OrderedSetIterator implements Iterator { 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; } From 41008a1f358f27d92078a38926a0761a5f255154 Mon Sep 17 00:00:00 2001 From: Luan Nico Date: Thu, 17 Oct 2024 11:23:04 -0400 Subject: [PATCH 2/2] Update lib/ordered_set.dart --- lib/ordered_set.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ordered_set.dart b/lib/ordered_set.dart index a8d4845..6cb3bd9 100644 --- a/lib/ordered_set.dart +++ b/lib/ordered_set.dart @@ -202,7 +202,7 @@ class _OrderedSetIterator implements Iterator { } _innerIterator = _iterator.current.iterator; - return _innerIterator.moveNext(); + return _innerIterator!.moveNext(); } return true; }