From 9f5dad1998d82346e2ead345e11791ed114e32e0 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Sun, 16 Mar 2025 00:32:36 +0900 Subject: [PATCH] sandbox: return on zero length ops This dodges potentially confusing behaviour where init fails due to Ops being clobbered during transfer. Signed-off-by: Ophestra --- internal/sandbox/container.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/sandbox/container.go b/internal/sandbox/container.go index 6676a2a..fff1d9d 100644 --- a/internal/sandbox/container.go +++ b/internal/sandbox/container.go @@ -114,6 +114,9 @@ func (p *Container) Start() error { if p.cmd != nil { return errors.New("sandbox: already started") } + if p.Ops == nil || len(*p.Ops) == 0 { + return errors.New("sandbox: starting an empty container") + } c, cancel := context.WithCancel(p.ctx) p.cancel = cancel