don't truncate a null string. Fixes #262

This commit is contained in:
clinton-hall 2014-02-14 14:17:56 +10:30
commit 71f35179c7

View file

@ -134,7 +134,7 @@ def main(inputDirectory, inputName, inputCategory, inputHash, inputID):
if inputCategory in noFlatten: if inputCategory in noFlatten:
newDir = dirpath # find the full path newDir = dirpath # find the full path
newDir = newDir.replace(inputDirectory, "") #find the extra-depth directory 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. newDir = newDir[1:] # remove leading "/" to enable join to work.
outputDestination = os.path.join(outputDestinationMaster, newDir) # join this extra directory to output. outputDestination = os.path.join(outputDestinationMaster, newDir) # join this extra directory to output.
Logger.debug("MAIN: Setting outputDestination to %s to preserve folder structure", outputDestination) Logger.debug("MAIN: Setting outputDestination to %s to preserve folder structure", outputDestination)