Added a safety net for #1714: Documentation tool run into an infinite recursion

Even though I can't actually reproduce the bug