diff --git a/apyds/ds.cc b/apyds/ds.cc index 142914f..b1b80bf 100644 --- a/apyds/ds.cc +++ b/apyds/ds.cc @@ -18,7 +18,7 @@ class Iterator { iterator = std::make_unique(generator.begin()); initialized = true; } - if (*iterator == nullptr) { + if (*iterator == generator.end()) { return nullptr; } ds::rule_t* result = **iterator; diff --git a/atsds/ds.cc b/atsds/ds.cc index 03bbe29..f94f84c 100644 --- a/atsds/ds.cc +++ b/atsds/ds.cc @@ -17,7 +17,7 @@ class Iterator { iterator = std::make_unique(generator.begin()); initialized = true; } - if (*iterator == nullptr) { + if (*iterator == generator.end()) { return nullptr; } ds::rule_t* result = **iterator;