Add check for empty custom taxonomy.

Prevent filtering on an empty taxonomy that will cause the query to fail.