Exit search function if DOM node is missing.