Skip to content

Commit

Permalink
fix: handling non-semantic versions
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonyharrison committed Dec 9, 2024
1 parent 027a104 commit fc6fa71
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib4sbom/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,14 @@ def _get_element(self, name, id=None):
current_version = self._semantic_version(
c[1].split("_")[-1]
)
if current_version > latest_version:
latest_version = current_version
index = i
try:
if current_version > latest_version:
latest_version = current_version
index = i
except TypeError:
if self.debug:
print (f"Current {current_version} {type(current_version)} {name}")
print (f"Latest {latest_version} {type(latest_version)}")
elif c[1] == id:
return c[0]
i += 1
Expand Down

0 comments on commit fc6fa71

Please sign in to comment.