Skip to content

Commit e7c8c10

Browse files
committed
Fix nil pointer dereference fatal
``` The command '/bin/sh -c RAILS_ENV=${rails_env} HOST=${host} bundle exec rake assets:precompile' returned a non-zero code: 1 panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x886d50] goroutine 1 [running]: github.com/firehydrant/fhcli/pkg/cli.executeCmd(0xc000106840, 0xc000445980, 0x14) /go/src/github.com/firehydrant/fhcli/pkg/cli/execute.go:58 +0x850 github.com/firehydrant/fhcli/vendor/gopkg.in/urfave/cli%2ev1.HandleAction(0x8eaee0, 0x9da7e8, 0xc000106840, 0xc0000ac800, 0x0) /go/src/github.com/firehydrant/fhcli/vendor/gopkg.in/urfave/cli.v1/app.go:490 +0xc8 github.com/firehydrant/fhcli/vendor/gopkg.in/urfave/cli%2ev1.Command.Run(0x9b7ca0, 0x7, 0x0, 0x0, 0x0, 0x0, 0x0, 0x9d0792, 0x3b, 0x0, ...) /go/src/github.com/firehydrant/fhcli/vendor/gopkg.in/urfave/cli.v1/command.go:210 +0x9a2 github.com/firehydrant/fhcli/vendor/gopkg.in/urfave/cli%2ev1.(*App).Run(0xc0000d84e0, 0xc00001c1a0, 0xd, 0xd, 0x0, 0x0) /go/src/github.com/firehydrant/fhcli/vendor/gopkg.in/urfave/cli.v1/app.go:255 +0x687 main.main() /go/src/github.com/firehydrant/fhcli/cmd/main.go:16 +0x87 Exited with code 2 ```
1 parent 708b705 commit e7c8c10

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/cli/execute.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func executeCmd(c *cli.Context) error {
5555

5656
// getting the exit code is a pita so i'm not doing it yet
5757
if cErr != nil {
58-
identities["error"] = err.Error()
58+
identities["error"] = cErr.Error()
5959
fmt.Println(fmt.Sprintf("Executed command, duration %dms, error: %s", duration, cErr))
6060
} else {
6161
fmt.Println(fmt.Sprintf("Executed command, duration %dms", duration))

0 commit comments

Comments
 (0)