adding for loop on list to to handle the return of none when the list is empty. With the previous method if the list was empty the script died. See http://stackoverflow.com/questions/18852324/typeerror-sequence-item-0-expected-string-nonetype-found
Merge pull request #9368 from silvax/handle-return-non-on-join

as I read it, the issue is with a None item in the list, not with an empty list (tests return empty string), still fixes a traceback