Skip to content

Commit 06a9ae8

Browse files
committed
Enhance proof_of_life_url property to handle missing documents
1 parent 5b787a9 commit 06a9ae8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

mati/resources/verifications.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,10 @@ def proof_of_life_document(self) -> Optional[Liveness]:
8888
@property
8989
def proof_of_life_url(self) -> Optional[str]:
9090
pol = self.proof_of_life_document
91-
return pol.data.get('video_url') or pol.data.get( # type: ignore
92-
'selfie_photo_url'
93-
)
91+
if not pol:
92+
return None
93+
data = getattr(pol, 'data', {}) or {}
94+
return data.get('video_url') or data.get('selfie_photo_url')
9495

9596
@property
9697
def proof_of_life_errors(self) -> List[Errors]:

0 commit comments

Comments
 (0)