File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -180,12 +180,15 @@ func handleEnvs(conf Config, results <-chan getResult) error {
180180 continue
181181 }
182182 data := r .data
183- if data [len (data )- 1 ] != '\n' {
184- data = append (data , '\n' )
185- }
186- log .Printf ("Loading %s/%s (%d bytes) of env" , r .bucket , r .key , len (r .data ))
187- if _ , err := bytes .NewReader (data ).WriteTo (conf .EnvSink ); err != nil {
188- return fmt .Errorf ("copying env: %w" , err )
183+
184+ if len (data ) > 0 {
185+ if data [len (data )- 1 ] != '\n' {
186+ data = append (data , '\n' )
187+ }
188+ log .Printf ("Loading %s/%s (%d bytes) of env" , r .bucket , r .key , len (r .data ))
189+ if _ , err := bytes .NewReader (data ).WriteTo (conf .EnvSink ); err != nil {
190+ return fmt .Errorf ("copying env: %w" , err )
191+ }
189192 }
190193 }
191194 return nil
You can’t perform that action at this time.
0 commit comments