File tree 3 files changed +11
-2
lines changed
3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 1
1
module . exports = {
2
2
root : true ,
3
3
parserOptions : {
4
- ecmaVersion : 6 ,
4
+ ecmaVersion : 'latest' ,
5
5
sourceType : 'module'
6
6
} ,
7
7
extends : 'eslint:recommended' ,
Original file line number Diff line number Diff line change @@ -166,7 +166,7 @@ module.exports = CoreObject.extend({
166
166
var revisionPrefix = joinUriSegments ( prefix , options . filePattern + ":" + options . revisionKey ) ;
167
167
168
168
return listObjects ( { Bucket : bucket , Prefix : revisionPrefix } )
169
- . then ( ( response ) => response . Contents . find ( ( element ) => element . Key === revisionPrefix ) ) ;
169
+ . then ( ( response ) => response . Contents ? .find ( ( element ) => element . Key === revisionPrefix ) ) ;
170
170
} ,
171
171
172
172
fetchRevisions : function ( options ) {
Original file line number Diff line number Diff line change @@ -242,6 +242,15 @@ describe('s3', function() {
242
242
} ) ;
243
243
} ) ;
244
244
245
+ it ( 'succeeds when revision key search returns no values' , function ( ) {
246
+ s3Client . listObjects = function ( params , cb ) {
247
+ cb ( undefined , { } ) ;
248
+ } ;
249
+ var promise = subject . upload ( options ) ;
250
+
251
+ return assert . isFulfilled ( promise ) ;
252
+ } ) ;
253
+
245
254
describe ( "when revisionKey was already uploaded" , function ( ) {
246
255
beforeEach ( function ( ) {
247
256
options . revisionKey = "123" ;
You can’t perform that action at this time.
0 commit comments