diff --git a/semver/scm/git.py b/semver/scm/git.py index 80f76d4..cc1255a 100644 --- a/semver/scm/git.py +++ b/semver/scm/git.py @@ -29,7 +29,7 @@ class Git(SCM): def _run_command( self, *args: str, throwExceptions: bool = True - ) -> subprocess.CompletedProcess[str]: + ) -> subprocess.CompletedProcess: return subprocess.run( args, capture_output=True, @@ -82,7 +82,11 @@ class Git(SCM): f"Error getting latest tagged git version: {str(e.stderr).rstrip()}" ) - if len(tagged_versions) > 0 and tagged_versions[-1] != "": + if ( + tagged_versions is not None + and len(tagged_versions) > 0 + and tagged_versions[-1] != "" + ): version = tagged_versions[-1] logger.debug(f"Tag Version: {version}")