Merge pull request #2499 from MukulKolpe/bugsByVersionLC

Added length check on `bugs_by_version` for specific `version_number`
pull/2508/head
alpharush 5 months ago committed by GitHub
commit 8499b5d23b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      slither/detectors/attributes/incorrect_solc.py

@ -71,7 +71,7 @@ Consider using the latest version of Solidity for testing."""
if op and op not in [">", ">=", "^"]: if op and op not in [">", ">=", "^"]:
return self.LESS_THAN_TXT return self.LESS_THAN_TXT
version_number = ".".join(version[2:]) version_number = ".".join(version[2:])
if version_number in bugs_by_version: if version_number in bugs_by_version and len(bugs_by_version[version_number]):
bugs = "\n".join([f"\t- {bug}" for bug in bugs_by_version[version_number]]) bugs = "\n".join([f"\t- {bug}" for bug in bugs_by_version[version_number]])
return self.BUGGY_VERSION_TXT + f"\n{bugs}" return self.BUGGY_VERSION_TXT + f"\n{bugs}"
return None return None

Loading…
Cancel
Save