Skip to content

Commit

Permalink
Fix nil exception
Browse files Browse the repository at this point in the history
```
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x1805900]

goroutine 1 [running]:
github.com/guardllamanet/guardllama/internal/cli/glminstaller.trackRunE.func1.1()
        /home/runner/work/guardllama/guardllama/internal/cli/glminstaller/report.go:105 +0x50
github.com/guardllamanet/guardllama/internal/cli/glminstaller.trackRunE.func1(0x40006fe600?, {0x33a9a98, 0x0, 0x0})
        /home/runner/work/guardllama/guardllama/internal/cli/glminstaller/report.go:112 +0x234
github.com/spf13/cobra.(*Command).execute(0x40006fe600, {0x33a9a98, 0x0, 0x0})
        /home/runner/work/guardllama/guardllama/vendor/github.com/spf13/cobra/command.go:916 +0x5c4
github.com/spf13/cobra.(*Command).ExecuteC(0x40006fe300)
        /home/runner/work/guardllama/guardllama/vendor/github.com/spf13/cobra/command.go:1044 +0x340
github.com/spf13/cobra.(*Command).Execute(...)
        /home/runner/work/guardllama/guardllama/vendor/github.com/spf13/cobra/command.go:968
github.com/guardllamanet/guardllama/internal/cli/glminstaller.Main()
        /home/runner/work/guardllama/guardllama/internal/cli/glminstaller/glminstaller.go:36 +0x1e8
main.main()
        /home/runner/work/guardllama/guardllama/cmd/glm-installer/main.go:11 +0x1c
```
  • Loading branch information
llamaonduty committed Apr 30, 2023
1 parent 5b45a71 commit 44719dc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/cli/glminstaller/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func trackRunE(runE func(*cobra.Command, []string) error) func(*cobra.Command, [

defer func() {
if trackEvent != nil {
if e := trackEvent.CaptureErrAndReport(err); e != nil {
if err := trackEvent.CaptureErrAndReport(err); err != nil {
logger.Debug("error sending telemetry", "error", err.Error())
}
}
Expand Down

0 comments on commit 44719dc

Please sign in to comment.