fix(pkg/logfile): set creation date only if nil

This commit is contained in:
Markus Pesch 2019-06-15 12:04:14 +02:00
parent 7a3b3c6218
commit fbb062d091
Signed by: volker.raschek
GPG Key ID: 852BCC170D81A982

View File

@ -176,6 +176,8 @@ func WriteTemperaturesCustom(temperatures []*types.Temperature, w io.Writer, com
func writeCreationDate(temperatures []*types.Temperature) {
now := time.Now()
for _, temperature := range temperatures {
temperature.CreationDate = &now
if temperature.CreationDate == nil {
temperature.CreationDate = &now
}
}
}