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 {
146146 if ( this . _generateKey instanceof Function ) {
147147 try {
148148 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' ) ;
151151 }
152152 }
153153
@@ -189,7 +189,7 @@ class S3Adapter {
189189 const location = `${ endpoint } /${ params . Key } ` ;
190190
191191 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
193193 url = await this . getFileLocation ( config , key_without_prefix ) ;
194194 }
195195
You can’t perform that action at this time.
0 commit comments