mirror of
https://iceshrimp.dev/crimekillz/iceshrimp-161sh.git
synced 2024-11-22 12:13:48 +01:00
fix: skip attachment import if undefined
This commit is contained in:
parent
24f636170e
commit
13265e6652
@ -44,6 +44,13 @@ function processMastoFile(fn: string, path: string, dir: string, uid: string) {
|
||||
logger.info(`Unzip to ${dir}`);
|
||||
const outbox = JSON.parse(fs.readFileSync(`${dir}/outbox.json`));
|
||||
for (const note of outbox.orderedItems) {
|
||||
// Skip if attachment is undefined or not iterable
|
||||
if (
|
||||
note.object.attachment == null ||
|
||||
!note.object.attachment[Symbol.iterator]
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
for (const attachment of note.object.attachment) {
|
||||
const url = attachment.url.replaceAll("..", "");
|
||||
if (url.indexOf("\0") !== -1) {
|
||||
|
Loading…
Reference in New Issue
Block a user