Skip to content

Commit

Permalink
Merge pull request #197 from dpacbach/fix-iterators
Browse files Browse the repository at this point in the history
Fix ucl++ bug where iterators stop on a UCL_NULL field.
  • Loading branch information
vstakhov committed Dec 9, 2018
2 parents d67ea82 + eb2b39c commit 41066de
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/ucl++.h
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ class Ucl final {
it = std::shared_ptr<void>(ucl_object_iterate_new (obj.obj.get()),
ucl_iter_deleter());
cur.reset (new Ucl(ucl_object_iterate_safe (it.get(), true)));
if (cur->type() == UCL_NULL) {
if (!cur->obj) {
it.reset ();
cur.reset ();
}
Expand Down Expand Up @@ -230,7 +230,7 @@ class Ucl final {
cur.reset (new Ucl(ucl_object_iterate_safe (it.get(), true)));
}

if (cur && cur->type() == UCL_NULL) {
if (cur && !cur->obj) {
it.reset ();
cur.reset ();
}
Expand Down

0 comments on commit 41066de

Please sign in to comment.