Skip to content

Commit

Permalink
Merge pull request #358 from alecmerdler/fix-debug-panic
Browse files Browse the repository at this point in the history
Fix panic on permission check error
  • Loading branch information
vroldanbet authored Mar 23, 2024
2 parents 163db89 + 88372b2 commit 581f04f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/commands/permission.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,12 @@ func checkCmdFunc(cmd *cobra.Command, args []string) error {
var trailerMD metadata.MD
resp, err := client.CheckPermission(ctx, request, grpc.Trailer(&trailerMD))
if err != nil {
derr := displayDebugInformationIfRequested(cmd, resp.DebugTrace, trailerMD, true)
var debugInfo *v1.DebugInformation
if resp != nil {
debugInfo = resp.DebugTrace
}

derr := displayDebugInformationIfRequested(cmd, debugInfo, trailerMD, true)
if derr != nil {
return derr
}
Expand Down

0 comments on commit 581f04f

Please sign in to comment.