Skip to content

Commit

Permalink
Update with checks for None
Browse files Browse the repository at this point in the history
  • Loading branch information
cjb873 committed Dec 5, 2023
1 parent cf7e9e0 commit dbb0b9a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions zeek-package-website/app/api/readme_scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ def load_packages() -> []:
def find_missing(package: dict) -> []:
missing = []

if(package is None):
return None

for key in package.keys():
if package[key] is None and key in fields.keys():
missing.append(key)
Expand All @@ -42,6 +45,9 @@ def find_missing(package: dict) -> []:

def get_field(readme: str, field: str) -> str:

if readme is None or field is None:
return None

search_term = f"{fields[field]}"

field = re.search(f'(?<=# {search_term})(.*)(?=\n)', readme.lower())
Expand Down

0 comments on commit dbb0b9a

Please sign in to comment.