Commit 08dcf830 by vincent

fixed a bug of not resolving the Promise when detectSingleFace returns no result

parent 16b7dc6c
...@@ -90,7 +90,7 @@ export class DetectSingleFaceTask extends DetectFacesTaskBase<FaceDetection | un ...@@ -90,7 +90,7 @@ export class DetectSingleFaceTask extends DetectFacesTaskBase<FaceDetection | un
private runAndExtendWithFaceDetection(): Promise<WithFaceDetection<{}>> { private runAndExtendWithFaceDetection(): Promise<WithFaceDetection<{}>> {
return new Promise<WithFaceDetection<{}>>(async res => { return new Promise<WithFaceDetection<{}>>(async res => {
const detection = await this.run() const detection = await this.run()
return detection ? res(extendWithFaceDetection<{}>({}, detection)) : null return res(detection ? extendWithFaceDetection<{}>({}, detection) : undefined)
}) })
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment