diff --git a/scripts/release.sh b/scripts/release.sh
index bc1ddc5780..6709c5c358 100755
--- a/scripts/release.sh
+++ b/scripts/release.sh
@@ -29,6 +29,13 @@ function main() {
   local vVersion="v${version}"
   echo "Current version: ${vVersion}"
 
+  # Get the version to bump to from the semver-tool and the bump type
+  local newVersion=$(docker run --rm --platform=linux/amd64 -i "${DOCKER_IMAGE_SEMVER}" bump "${BUMP_TYPE}" "${vVersion}")
+  if [[ "${newVersion}" == "" ]]; then
+    echo "Failed to bump the version. Please check the semver-tool image and the bump type."
+    exit 1
+  fi
+
   # Commit the project in the current state
   gitCommitVersion "${vVersion}"
 
@@ -45,8 +52,6 @@ function main() {
     done
   done
 
-  # Get the version to bump to from the semver-tool and the bump type
-  local newVersion=$(docker run --rm --platform=linux/amd64 -i "${DOCKER_IMAGE_SEMVER}" bump "${BUMP_TYPE}" "${vVersion}")
   echo "Producing a ${BUMP_TYPE} bump of the version, from ${version} to ${newVersion}"
 
   # Bump the version in the version.go file