1
1
mirror of https://github.com/kokonect-link/cherrypick synced 2024-11-30 07:48:57 +09:00

Fix several file processings (#2968)

* Ignore image error in person

* Fix hang while processing empty file
This commit is contained in:
MeiMei 2018-10-21 18:35:36 +09:00 committed by syuilo
parent b8ed8336e0
commit 72754ede4e
2 changed files with 6 additions and 2 deletions

View File

@ -190,7 +190,7 @@ export async function createPerson(uri: string, resolver?: Resolver): Promise<IU
].map(img =>
img == null
? Promise.resolve(null)
: resolveImage(user, img)
: resolveImage(user, img).catch(() => null)
)));
const avatarId = avatar ? avatar._id : null;
@ -276,7 +276,7 @@ export async function updatePerson(uri: string, resolver?: Resolver, hint?: obje
].map(img =>
img == null
? Promise.resolve(null)
: resolveImage(exist, img)
: resolveImage(exist, img).catch(() => null)
)));
// Update user

View File

@ -185,6 +185,10 @@ export default async function(
// 種類が同定できなかったら application/octet-stream にする
res(['application/octet-stream', null]);
}
})
.on('end', () => {
// maybe 0 bytes
res(['application/octet-stream', null]);
});
});