same as in line 104.  The loop shall be skipped when str is not defined or (it is defined) and it is empty.