storage-py icon indicating copy to clipboard operation
storage-py copied to clipboard

BUGFIX: `NoneType` object has no attribute `lstrip`

Open SiddhantSadangi opened this issue 2 years ago • 1 comments

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.

SiddhantSadangi avatar Aug 01 '23 18:08 SiddhantSadangi

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

github-actions[bot] avatar Aug 02 '24 00:08 github-actions[bot]