From 71f35179c7fc4e9dd13283a59897bdbf9a335b6f Mon Sep 17 00:00:00 2001 From: clinton-hall Date: Fri, 14 Feb 2014 14:17:56 +1030 Subject: [PATCH] don't truncate a null string. Fixes #262 --- TorrentToMedia.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TorrentToMedia.py b/TorrentToMedia.py index 8e3c9b52..6da2cadf 100755 --- a/TorrentToMedia.py +++ b/TorrentToMedia.py @@ -134,7 +134,7 @@ def main(inputDirectory, inputName, inputCategory, inputHash, inputID): if inputCategory in noFlatten: newDir = dirpath # find the full path newDir = newDir.replace(inputDirectory, "") #find the extra-depth directory - if newDir[0] == "/": + if len(newDir) > 0 and newDir[0] == "/": newDir = newDir[1:] # remove leading "/" to enable join to work. outputDestination = os.path.join(outputDestinationMaster, newDir) # join this extra directory to output. Logger.debug("MAIN: Setting outputDestination to %s to preserve folder structure", outputDestination)