Skip to content

fix(common): add nil safety and normalize version comparison in CheckVersionUpdate - #599

Open
Tyagiquamar wants to merge 2 commits into
civo:masterfrom
Tyagiquamar:fix/version-check-nil-safety
Open

fix(common): add nil safety and normalize version comparison in CheckVersionUpdate#599
Tyagiquamar wants to merge 2 commits into
civo:masterfrom
Tyagiquamar:fix/version-check-nil-safety

Conversation

@Tyagiquamar

Copy link
Copy Markdown

\CheckVersionUpdate\ in \common/common.go\ could previously panic if
es\ or
es.TagName\ was nil (e.g. from network or rate-limiting error paths). Additionally, the version tag checks contained nested logic that did not consistently handle \�-prefix version strings across binary build flags and GitHub release tag names.

This fix:

  1. Adds
    es == nil || res.TagName == nil\ safety checks before dereferencing release tag names.
  2. Normalizes \�\ prefixes using \strings.TrimPrefix\ so \�1.0.0\ and \1.0.0\ evaluate identically.
  3. Adds unit test coverage in \common/common_test.go.

Fixes #313.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add config option to disable github version checks

2 participants