From a32342cf4780be6935a094b0ec88884044c3acd4 Mon Sep 17 00:00:00 2001 From: Beatriz Vieira Date: Sun, 17 Nov 2019 14:03:50 -0300 Subject: [PATCH] fix: nil reference on ToVersion --- sv/semver.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sv/semver.go b/sv/semver.go index f6e2350..1c0523c 100644 --- a/sv/semver.go +++ b/sv/semver.go @@ -18,7 +18,10 @@ func ToVersion(value string) (semver.Version, error) { version = "0.0.0" } v, err := semver.NewVersion(version) - return *v, err + if err != nil { + return semver.Version{}, err + } + return *v, nil } // BreakingChangeTag breaking change tag from commit metadata