File tree Expand file tree Collapse file tree 1 file changed +12
-11
lines changed
Expand file tree Collapse file tree 1 file changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -129,19 +129,20 @@ class Bucket extends baseBucket {
129129 this . cos . bucket . get ( params , ( error , data ) => {
130130 console . log ( 'list objects: ' , data )
131131 let files = [ ]
132- if ( ! Array . isArray ( data . ListBucketResult . Contents ) ) {
133- data . ListBucketResult . Contents = [ data . ListBucketResult . Contents ]
134- }
135- data . ListBucketResult . Contents . forEach ( item => {
136- if ( parseInt ( item . Size ) !== 0 ) {
137- files . push ( util . convertMeta ( item , brand . ks3 . key ) )
132+ if ( data . ListBucketResult . Contents ) {
133+ if ( ! Array . isArray ( data . ListBucketResult . Contents ) ) {
134+ data . ListBucketResult . Contents = [ data . ListBucketResult . Contents ]
138135 }
139- } )
140-
141- data . CommonPrefixes &&
142- data . CommonPrefixes . forEach ( item => {
143- files . push ( this . _getFolder ( item . Prefix ) )
136+ data . ListBucketResult . Contents . forEach ( item => {
137+ if ( parseInt ( item . Size ) !== 0 ) {
138+ files . push ( util . convertMeta ( item , brand . ks3 . key ) )
139+ }
144140 } )
141+ }
142+
143+ data . ListBucketResult . CommonPrefixes && data . ListBucketResult . CommonPrefixes . forEach ( item => {
144+ files . push ( this . _getFolder ( item . Prefix ) )
145+ } )
145146
146147 this . postResources (
147148 {
You can’t perform that action at this time.
0 commit comments