diff --git a/libpod/container_inspect.go b/libpod/container_inspect.go index 64419329cd..b3aa2510f4 100644 --- a/libpod/container_inspect.go +++ b/libpod/container_inspect.go @@ -315,7 +315,7 @@ func (c *Container) GetSecurityOptions() []string { if apparmor, ok := ctrSpec.Annotations[define.InspectAnnotationApparmor]; ok { SecurityOpt = append(SecurityOpt, fmt.Sprintf("apparmor=%s", apparmor)) } - if c.config.Spec.Linux.MaskedPaths == nil { + if c.config.Spec != nil && c.config.Spec.Linux != nil && c.config.Spec.Linux.MaskedPaths == nil { SecurityOpt = append(SecurityOpt, "unmask=all") }