Make sure empty terms are not created when importing a CSV file.

#6080 

This PR adds a check to see if any terms are provided in order to avoid creating empty terms.