File tree Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 11module . exports = {
22 root : true ,
33 parserOptions : {
4- ecmaVersion : 6 ,
4+ ecmaVersion : 'latest' ,
55 sourceType : 'module'
66 } ,
77 extends : 'eslint:recommended' ,
Original file line number Diff line number Diff line change @@ -166,7 +166,7 @@ module.exports = CoreObject.extend({
166166 var revisionPrefix = joinUriSegments ( prefix , options . filePattern + ":" + options . revisionKey ) ;
167167
168168 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 ) ) ;
170170 } ,
171171
172172 fetchRevisions : function ( options ) {
Original file line number Diff line number Diff line change @@ -242,6 +242,15 @@ describe('s3', function() {
242242 } ) ;
243243 } ) ;
244244
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+
245254 describe ( "when revisionKey was already uploaded" , function ( ) {
246255 beforeEach ( function ( ) {
247256 options . revisionKey = "123" ;
You can’t perform that action at this time.
0 commit comments