Skip to content

Commit

Permalink
fix: fix the segment violation error when running the clean command w…
Browse files Browse the repository at this point in the history
…ith the version hasn't been initialized yet #217 (#218)
  • Loading branch information
flelli authored May 18, 2023
1 parent c4891a9 commit 0c33240
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
18 changes: 18 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Nyx Release Notes

## 2.3.5

This release is available at [this link](https://github.com/mooltiverse/nyx/releases/tag/2.3.5).

### Upgrade instructions

There are no actions to take for backward compatibility.

### New features and improvements

There are no new features or improvements in this release.

### Fixed issues

This release:

* fixes a bug in the command line version that caused a segment violation error when running the `clean` command when no previous state is found and so the current version hasn't been initialized yet ([#217](https://github.com/mooltiverse/nyx/issues/217))

## 2.3.4

This release is available at [this link](https://github.com/mooltiverse/nyx/releases/tag/2.3.4).
Expand Down
12 changes: 8 additions & 4 deletions modules/go/nyx/state/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -950,11 +950,15 @@ func (s *State) Summary() (string, error) {
}
fmt.Fprintf(&buf, "timestamp = %d\n", *timestamp)

version, err := s.GetVersion()
if err != nil {
return "", err
if s.HasVersion() {
version, err := s.GetVersion()
if err != nil {
return "", err
}
fmt.Fprintf(&buf, "current version = %s\n", *version)
} else {
fmt.Fprintf(&buf, "current version = %s\n", "")
}
fmt.Fprintf(&buf, "current version = %s\n", *version)

releaseScope, err := s.GetReleaseScope()
if err != nil {
Expand Down

0 comments on commit 0c33240

Please sign in to comment.