mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-27 07:48:55 +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:
parent
9b689ea1d7
commit
b2ec5a43d5
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user