Fix several file processings (#2968)
* Ignore image error in person * Fix hang while processing empty file
This commit is contained in:
parent
b8ed8336e0
commit
72754ede4e
|
@ -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
|
||||
|
|
|
@ -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]);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue