Skip to content

Commit 15df0e0

Browse files
eeatonawsThomas Leing
authored andcommitted
fix(liveness): check for empty session ID (#53)
1 parent d66eb82 commit 15df0e0

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

liveness/src/main/java/com/amplifyframework/ui/liveness/ui/FaceLivenessDetector.kt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,17 @@ fun FaceLivenessDetector(
9898
return
9999
}
100100

101+
// fails challenge if session ID is empty
102+
if (sessionId.isBlank()) {
103+
LaunchedEffect(key) {
104+
isFinished = true
105+
currentOnError.accept(
106+
FaceLivenessDetectionException.SessionNotFoundException("Session ID cannot be empty.")
107+
)
108+
}
109+
return
110+
}
111+
101112
// Locks portrait orientation for duration of challenge and resets on complete
102113
LockPortraitOrientation()
103114

0 commit comments

Comments
 (0)