Skip to content

Commit 50cc11f

Browse files
committed
Fix npe
1 parent 09362de commit 50cc11f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

internal/nix/install.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const rootError = "warning: installing Nix as root is not supported by this scri
2929

3030
// Install runs the install script for Nix. daemon has 3 states
3131
// nil is unset. false is --no-daemon. true is --daemon.
32-
func Install(writer io.Writer, daemon func() *bool) error {
32+
func Install(writer io.Writer, daemonFn func() *bool) error {
3333
if isRoot() && build.OS() == build.OSWSL {
3434
return usererr.New("Nix cannot be installed as root on WSL. Please run as a normal user with sudo access.")
3535
}
@@ -51,8 +51,8 @@ func Install(writer io.Writer, daemon func() *bool) error {
5151
installScript += " linux --init none"
5252
}
5353
installScript += " --no-confirm"
54-
} else if daemon != nil {
55-
if *daemon() {
54+
} else if daemon := daemonFn(); daemon != nil {
55+
if *daemon {
5656
installScript += " -- --daemon"
5757
} else {
5858
installScript += " -- --no-daemon"

0 commit comments

Comments
 (0)