bug fix for file create with "-undefined" hash

avoid to have file with undefined hash when truncateHash is not set