util: Nil input to our simple cmd helper should be allowed

Don't panic here!
This commit is contained in:
James Shubin
2024-10-25 18:17:04 -04:00
parent 7d204dfb74
commit 8c886bbe7c

View File

@@ -82,7 +82,7 @@ func SimpleCmd(ctx context.Context, name string, args []string, opts *SimpleCmdO
err := cmd.Wait() // we can unblock this with the timeout
out := b.String()
if opts.LogOutput != "" {
if opts != nil && opts.LogOutput != "" {
if err := os.WriteFile(opts.LogOutput, b.Bytes(), 0600); err != nil {
logf("unable to store log: %v", err)
} else {