diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-03-16 00:32:36 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-03-16 00:32:36 +0900 |
| commit | 9f5dad1998d82346e2ead345e11791ed114e32e0 (patch) | |
| tree | 184c621b13f1c1151af6991289c26c466e5df66f /internal | |
| parent | 6e7ddb2d2ec6b163dc2c178bc4d73b5943f51206 (diff) | |
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 <cat@gensokyo.uk>
Diffstat (limited to 'internal')
| -rw-r--r-- | internal/sandbox/container.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/internal/sandbox/container.go b/internal/sandbox/container.go index 6676a2a9..fff1d9d8 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 |
