Skip to content

Commit

Permalink
fix NPE when out of disk space
Browse files Browse the repository at this point in the history
  • Loading branch information
nicpottier committed Nov 6, 2020
1 parent 7b676bd commit 6d89c9d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion archiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ func CreateArchiveFile(ctx context.Context, db *sqlx.DB, archive *Archive, archi
filename := fmt.Sprintf("%s_%d_%s%d%02d%02d_", archive.ArchiveType, archive.Org.ID, archive.Period, archive.StartDate.Year(), archive.StartDate.Month(), archive.StartDate.Day())
file, err := ioutil.TempFile(archivePath, filename)
if err != nil {
return errors.Wrapf(err, "error creating temp file: %s", file.Name())
return errors.Wrapf(err, "error creating temp file: %s", filename)
}
hash := md5.New()
gzWriter := gzip.NewWriter(io.MultiWriter(file, hash))
Expand Down

0 comments on commit 6d89c9d

Please sign in to comment.