storage-py
storage-py copied to clipboard
BUGFIX: `NoneType` object has no attribute `lstrip`
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.
This pull request is stale because it has been open for 365 days with no activity.