rewrite: Only ref condition filter, if it is not NULL.