Skip to content

Commit

Permalink
Merge pull request #1565 from allencloud/fix-potential-panic
Browse files Browse the repository at this point in the history
fix a potential panic when map is nil
  • Loading branch information
estesp committed Sep 27, 2017
2 parents cc9f58a + 382dafe commit b24acea
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions image.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ func (i *image) Unpack(ctx context.Context, snapshotterName string) error {
if err != nil {
return err
}
if info.Labels == nil {
info.Labels = map[string]string{}
}
if info.Labels["containerd.io/uncompressed"] != layer.Diff.Digest.String() {
if info.Labels == nil {
info.Labels = map[string]string{}
}
info.Labels["containerd.io/uncompressed"] = layer.Diff.Digest.String()
if _, err := cs.Update(ctx, info, "labels.containerd.io/uncompressed"); err != nil {
return err
Expand Down

0 comments on commit b24acea

Please sign in to comment.