VID-1883 Check if category assigned before using search

Fair point. Updating.