Avoid infinite loop in "Toggle Contained Nodes" action
...when there is an empty range
Differential Revision: https://phabricator.kde.org/D21078