diff --git a/cmd/frostfs-cli/modules/tree/get_by_path.go b/cmd/frostfs-cli/modules/tree/get_by_path.go index 6f6fc7ff9d..69a3dc7ea9 100644 --- a/cmd/frostfs-cli/modules/tree/get_by_path.go +++ b/cmd/frostfs-cli/modules/tree/get_by_path.go @@ -71,7 +71,9 @@ func getByPath(cmd *cobra.Command, _ []string) { Path: strings.Split(path, "/"), LatestOnly: latestOnly, AllAttributes: true, - BearerToken: common.ReadBearerToken(cmd, bearerFlagKey).Marshal(), + } + if btok := common.ReadBearerToken(cmd, bearerFlagKey); btok != nil { + req.Body.BearerToken = btok.Marshal() } commonCmd.ExitOnErr(cmd, "message signing: %w", tree.SignMessage(req, pk))