Merge pull request #46731 from vvoland/c8d-history-fix-nil-deref
c8d/history: Fix nil dereference
This commit is contained in:
commit
987f76ea78
1 changed files with 5 additions and 1 deletions
|
@ -81,11 +81,15 @@ func (i *ImageService) ImageHistory(ctx context.Context, name string) ([]*imaget
|
|||
sizes = sizes[1:]
|
||||
}
|
||||
|
||||
var created int64
|
||||
if h.Created != nil {
|
||||
created = h.Created.Unix()
|
||||
}
|
||||
history = append([]*imagetype.HistoryResponseItem{{
|
||||
ID: "<missing>",
|
||||
Comment: h.Comment,
|
||||
CreatedBy: h.CreatedBy,
|
||||
Created: h.Created.Unix(),
|
||||
Created: created,
|
||||
Size: size,
|
||||
Tags: nil,
|
||||
}}, history...)
|
||||
|
|
Loading…
Add table
Reference in a new issue