Skip to content

Commit

Permalink
Merge pull request #1055 from ripienaar/subj_transform_empty
Browse files Browse the repository at this point in the history
Prevent empty subject transform settings from being set
  • Loading branch information
ripienaar committed May 8, 2024
2 parents 935f293 + d82d4c6 commit b9d1498
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cli/stream_command.go
Expand Up @@ -18,7 +18,6 @@ import (
"context"
"encoding/json"
"fmt"
iu "github.com/nats-io/natscli/internal/util"
"io"
"math"
"os"
Expand All @@ -32,6 +31,8 @@ import (
"syscall"
"time"

iu "github.com/nats-io/natscli/internal/util"

"github.com/AlecAivazis/survey/v2"
"github.com/choria-io/fisk"
"github.com/dustin/go-humanize"
Expand Down Expand Up @@ -1653,7 +1654,9 @@ func (c *streamCmd) copyAndEditStream(cfg api.StreamConfig, pc *fisk.ParseContex
subjectTransformConfig.Destination = c.subjectTransformDest
}

cfg.SubjectTransform = &subjectTransformConfig
if subjectTransformConfig.Source != "" && subjectTransformConfig.Destination != "" {
cfg.SubjectTransform = &subjectTransformConfig
}
}

return cfg, nil
Expand Down

0 comments on commit b9d1498

Please sign in to comment.