mirror of
https://github.com/outline/outline.git
synced 2026-06-13 11:25:03 +03:00
fix: Skip export attachments with malformed key (#12470)
Attachments whose key ends in a trailing slash have no filename component and cause yazl to throw, aborting the entire export. Skip them with a warning and continue the export instead. Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -70,6 +70,17 @@ export default abstract class ExportDocumentTreeTask extends ExportTask {
|
||||
key: attachment.key,
|
||||
});
|
||||
|
||||
// Skip attachments with a malformed key that has no filename component,
|
||||
// as yazl rejects entries whose path ends with a slash.
|
||||
if (!attachment.key || attachment.key.endsWith("/")) {
|
||||
Logger.warn(`Skipping attachment with invalid key`, {
|
||||
attachmentId: attachment.id,
|
||||
teamId: attachment.teamId,
|
||||
key: attachment.key,
|
||||
});
|
||||
continue;
|
||||
}
|
||||
|
||||
const dir = path.dirname(pathInZip);
|
||||
let buffer: Buffer;
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user