Fix a crash related to portal search