Skip to content

Commit

Permalink
accomodating for empty reference hits
Browse files Browse the repository at this point in the history
  • Loading branch information
Joon-Klaps committed Aug 7, 2024
1 parent da27e88 commit 95ac620
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion bin/custom_multiqc_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,12 @@ def read_dataframe_from_json(file, **kwargs):
pandas.DataFrame: The dataframe read from the file.
"""
with open(file, "r") as json_file:
data = json.load(json_file, **kwargs)
try:
data = json.load(json_file, **kwargs)
except json.JSONDecodeError as e:
logger.warning("Error reading JSON file %s: %s", file, e)
return pd.DataFrame()

# Check if 'query' key exists
if 'filename' not in data:
# Get the filename without path and suffix
Expand Down

0 comments on commit 95ac620

Please sign in to comment.