Fix a possible crash in excluded search condition