Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUGFIX: NoneType object has no attribute lstrip #126

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

SiddhantSadangi
Copy link

Checking if "signedURL" exists before trying to strip "/". cast doesn't convert NoneType to str at runtime if there is no signedURL returned.

What kind of change does this PR introduce?

Bug fix

What is the current behavior?

If get_signed_url or get_signed_urls don't return a signedURL for a file, cast(str, item['signedURL']).lstrip('/') fails with error 'NoneType' object has no attribute 'lstrip'.

What is the new behavior?

item['signedURL'].lstrip('/') will run only if item['signedURL'] exists.
Also removed cast from import as it was only being used here.

Additional context

Add any other context or screenshots.

Checking if "signedURL" exists before trying to strip "/".
`cast` doesn't convert `NoneType` to `str` at runtime if there is no signedURL returned.
@SiddhantSadangi SiddhantSadangi changed the title Update file_api.py BUGFIX: NoneType object has no attribute lstrip Aug 2, 2023
Copy link
Contributor

github-actions bot commented Aug 2, 2024

This pull request is stale because it has been open for 365 days with no activity.

@github-actions github-actions bot added the Stale label Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant