mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-10-28 07:42:28 +00:00
runtime: fix cleanupSandboxBindMounts panic
Found in UT:
--- FAIL: TestKataCleanupSandbox (0.00s)
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
panic: runtime error: invalid memory address or nil pointer dereference
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
This commit is contained in:
@@ -411,7 +411,7 @@ func setupSandboxBindMounts(sandbox *Sandbox) error {
|
||||
}
|
||||
|
||||
func cleanupSandboxBindMounts(sandbox *Sandbox) error {
|
||||
if len(sandbox.config.SandboxBindMounts) == 0 {
|
||||
if sandbox.config == nil || len(sandbox.config.SandboxBindMounts) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user