Check that ImageInspect pointer is not nil

This commit is contained in:
Ted Yu
2020-02-19 12:45:54 -08:00
parent cc36dda7e7
commit 884e5ee3d4

View File

@@ -415,7 +415,7 @@ func (ds *dockerService) ContainerStatus(_ context.Context, req *runtimeapi.Cont
labels, annotations := extractLabels(r.Config.Labels) labels, annotations := extractLabels(r.Config.Labels)
imageName := r.Config.Image imageName := r.Config.Image
if len(ir.RepoTags) > 0 { if ir != nil && len(ir.RepoTags) > 0 {
imageName = ir.RepoTags[0] imageName = ir.RepoTags[0]
} }
status := &runtimeapi.ContainerStatus{ status := &runtimeapi.ContainerStatus{