Refactor: Use correct name for sanitized filename in backup.js
This commit is contained in:
parent
770410ee88
commit
978ff0e2bb
1 changed files with 3 additions and 3 deletions
|
@ -457,11 +457,11 @@ async function readAttachment(dir, attachment, name, options) {
|
||||||
options = options || {};
|
options = options || {};
|
||||||
const { key } = options;
|
const { key } = options;
|
||||||
|
|
||||||
const anonymousName = _sanitizeFileName(name);
|
const sanitizedName = _sanitizeFileName(name);
|
||||||
const targetPath = path.join(dir, anonymousName);
|
const targetPath = path.join(dir, sanitizedName);
|
||||||
|
|
||||||
if (!fs.existsSync(targetPath)) {
|
if (!fs.existsSync(targetPath)) {
|
||||||
console.log(`Warning: attachment ${anonymousName} not found`);
|
console.log(`Warning: attachment ${sanitizedName} not found`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue