Skip to content

Commit

Permalink
fix: skip check on draft check runs with no transactions (#147)
Browse files Browse the repository at this point in the history
Resolution for `TypeError: the JSON object must be str, bytes or bytearray, not NoneType` when draft check run has no transactions.
  • Loading branch information
batonac authored Sep 7, 2023
1 parent 9d0ece3 commit b3821cb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions check_run/check_run/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ def disallow_cancellation_if_in_check_run(doc, method=None):
"Check Run", ["name", "transactions"], {"docstatus": 0}
)
for draft_check_run in draft_check_runs:
if not draft_check_run.transactions:
continue
transactions = [
t.get("ref_number") or t.get("name")
for t in json.loads(draft_check_run.transactions)
Expand Down

0 comments on commit b3821cb

Please sign in to comment.