Skip to content

Commit

Permalink
Fix nil pointer dereference fatal
Browse files Browse the repository at this point in the history
```
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
```
  • Loading branch information
dcondomitti committed Mar 27, 2019
1 parent 708b705 commit e7c8c10
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/cli/execute.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func executeCmd(c *cli.Context) error {

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

0 comments on commit e7c8c10

Please sign in to comment.