diff --git a/internal/commands/permission.go b/internal/commands/permission.go index e8d6c91..bb1938f 100644 --- a/internal/commands/permission.go +++ b/internal/commands/permission.go @@ -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 }