mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-10-23 21:28:10 +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 {
|
func cleanupSandboxBindMounts(sandbox *Sandbox) error {
|
||||||
if len(sandbox.config.SandboxBindMounts) == 0 {
|
if sandbox.config == nil || len(sandbox.config.SandboxBindMounts) == 0 {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user