Refactor: Use correct name for sanitized filename in backup.js

This commit is contained in:
Scott Nonnenberg 2018-04-19 15:17:01 -07:00
parent 770410ee88
commit 978ff0e2bb
No known key found for this signature in database
GPG key ID: 5F82280C35134661

View file

@ -457,11 +457,11 @@ async function readAttachment(dir, attachment, name, options) {
options = options || {};
const { key } = options;
const anonymousName = _sanitizeFileName(name);
const targetPath = path.join(dir, anonymousName);
const sanitizedName = _sanitizeFileName(name);
const targetPath = path.join(dir, sanitizedName);
if (!fs.existsSync(targetPath)) {
console.log(`Warning: attachment ${anonymousName} not found`);
console.log(`Warning: attachment ${sanitizedName} not found`);
return;
}