aws-amplify / amplify-ui-swift-liveness

This repository offers a UI component for Amazon Rekognition Face Liveness, enabling developers to ensure that only authentic users, and not bad actors using spoofs, can access their services.
https://ui.docs.amplify.aws/swift/connected-components/liveness
Apache License 2.0
10 stars 25 forks source link

fix: Fixing a crash when attempting to call finishWriting #161

Closed ruisebas closed 3 months ago

ruisebas commented 4 months ago

Issue #, if available:

Description of changes:

This PR attempts to fix an NSInternalInconsistencyException crash that might be happening when calling AVAssetWriter.finishWriting on an instance that is already completed.

There was a previous validation in place that checked if state != .complete, but state is a local variable that is not really tracking the write's state, so I decided to replace it with AVAssetWriter.status.

Check points: (check or cross out if not relevant)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

codecov[bot] commented 4 months ago

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 30.48%. Comparing base (da7f9fa) to head (4d96c38). Report is 3 commits behind head on main.

Files Patch % Lines
Sources/FaceLiveness/AV/VideoChunker.swift 0.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #161 +/- ## ======================================= Coverage 30.48% 30.48% ======================================= Files 57 57 Lines 2227 2227 ======================================= Hits 679 679 Misses 1548 1548 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.