File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -146,8 +146,8 @@ class S3Adapter {
146
146
if ( this . _generateKey instanceof Function ) {
147
147
try {
148
148
key_without_prefix = this . _generateKey ( filename , contentType , options ) ;
149
- } catch ( e ) {
150
- throw new Error ( e ) ; // throw error if generateKey function fails
149
+ } catch {
150
+ throw new Error ( 'Key generation failed' ) ;
151
151
}
152
152
}
153
153
@@ -189,7 +189,7 @@ class S3Adapter {
189
189
const location = `${ endpoint } /${ params . Key } ` ;
190
190
191
191
let url ;
192
- if ( Object . keys ( config ) . length != 0 ) { // if config is passed, we can generate a presigned url here
192
+ if ( config && typeof config === 'object' && Object . keys ( config ) . length > 0 ) { // if config is passed, we can generate a presigned url here
193
193
url = await this . getFileLocation ( config , key_without_prefix ) ;
194
194
}
195
195
You can’t perform that action at this time.
0 commit comments