Skip to content

Commit

Permalink
Add type check before S3 prefix check
Browse files Browse the repository at this point in the history
  • Loading branch information
Belval authored Jul 5, 2023
2 parents a19211f + 8a7dfda commit 8dbec37
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions textractor/textractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ def start_document_text_detection(
)

# If the file is not already in S3
if not file_source.startswith("s3://"):
if not isinstance(file_source, str) or not file_source.startswith("s3://"):
# Check if the user has given us a bucket to upload to
if not s3_upload_path:
raise InputError(
Expand Down Expand Up @@ -760,7 +760,7 @@ def start_expense_analysis(
)

# If the file is not already in S3
if not file_source.startswith("s3://"):
if not isinstance(file_source, str) or not file_source.startswith("s3://"):
# Check if the user has given us a bucket to upload to
if not s3_upload_path:
raise InputError(
Expand Down

0 comments on commit 8dbec37

Please sign in to comment.