Add a
```
 !empty($taxonomy_term)
```
 here instead of the if statement above to cover the case when someone puts "|" as well.