VID-1883 Check if category assigned before using search

I'd still leave this check here because there are other usages of this method