Skip to content

Commit 581f04f

Browse files
authored
Merge pull request #358 from alecmerdler/fix-debug-panic
Fix panic on permission check error
2 parents 163db89 + 88372b2 commit 581f04f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

internal/commands/permission.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,12 @@ func checkCmdFunc(cmd *cobra.Command, args []string) error {
206206
var trailerMD metadata.MD
207207
resp, err := client.CheckPermission(ctx, request, grpc.Trailer(&trailerMD))
208208
if err != nil {
209-
derr := displayDebugInformationIfRequested(cmd, resp.DebugTrace, trailerMD, true)
209+
var debugInfo *v1.DebugInformation
210+
if resp != nil {
211+
debugInfo = resp.DebugTrace
212+
}
213+
214+
derr := displayDebugInformationIfRequested(cmd, debugInfo, trailerMD, true)
210215
if derr != nil {
211216
return derr
212217
}

0 commit comments

Comments
 (0)