Skip to content

Commit 50d3e5f

Browse files
committed
run: fix nil deref using the option's logger (from #3431)
Signed-off-by: Nalin Dahyabhai <[email protected]>
1 parent 9514828 commit 50d3e5f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

run_linux.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ rootless=%d
253253

254254
defer func() {
255255
if err := cleanupRunMounts(runMountTargets, mountPoint); err != nil {
256-
options.Logger.Errorf("unabe to cleanup run mounts %v", err)
256+
options.Logger.Errorf("unable to cleanup run mounts %v", err)
257257
}
258258
}()
259259

@@ -1532,6 +1532,9 @@ func runUsingRuntimeMain() {
15321532
fmt.Fprintf(os.Stderr, "error decoding options: %v\n", err)
15331533
os.Exit(1)
15341534
}
1535+
if options.Options.Logger == nil {
1536+
options.Options.Logger = logrus.StandardLogger()
1537+
}
15351538
// Set ourselves up to read the container's exit status. We're doing this in a child process
15361539
// so that we won't mess with the setting in a caller of the library.
15371540
if err := setChildProcess(); err != nil {

0 commit comments

Comments
 (0)