[macdoc] Protect against NRE in the search field when typing Enter