diff --git a/src/lib/iter-chain-search.hpp b/src/lib/iter-chain-search.hpp index beeb69469..c662fb926 100644 --- a/src/lib/iter-chain-search.hpp +++ b/src/lib/iter-chain-search.hpp @@ -181,14 +181,17 @@ namespace iter { IterChainSearch&& > search (FUN&& configureSearchStep) { - Step nextStep{forward (configureSearchStep)}; - - if (_Base::isDisabled()) - this-> filter() = move (nextStep (*this)); // immediately apply first step - else // - stepChain_.emplace_back (move (nextStep)); // append all further steps into the chain... - // then establish invariant: - this->iterNext(); // expand to leaf and forward to first match + if (not this->empty()) + { + Step nextStep{forward (configureSearchStep)}; + + if (_Base::isDisabled()) + this-> filter() = move (nextStep (*this)); // immediately apply first step + else // + stepChain_.emplace_back (move (nextStep)); // append all further steps into the chain... + // then establish invariant: + this->iterNext(); // expand to leaf and forward to first match + } return move(*this); } diff --git a/src/lib/iter-tree-explorer.hpp b/src/lib/iter-tree-explorer.hpp index 650e161f1..8e73566a4 100644 --- a/src/lib/iter-tree-explorer.hpp +++ b/src/lib/iter-tree-explorer.hpp @@ -187,6 +187,7 @@ namespace lib { COR & _core() { return static_cast (*this); } COR const& _core() const { return static_cast (*this); } + protected: void __throw_if_empty() const { @@ -754,6 +755,7 @@ namespace lib { void iterNext() { + SRC::__throw_if_empty(); SRC::expandChildren(); } }; @@ -786,6 +788,7 @@ namespace lib { { if (shallExpand_) { + SRC::__throw_if_empty(); SRC::expandChildren(); shallExpand_ = false; } diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index 886e792a8..7a982f05f 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -32106,8 +32106,6 @@ - - @@ -32120,17 +32118,22 @@ + + - - + + + + + + + + - - -