Skip to content

Commit

Permalink
🧹 chore: Add validation to filter empty site fields and prevent excep…
Browse files Browse the repository at this point in the history
…tions
  • Loading branch information
DevaOnBreaches committed Jun 19, 2024
1 parent 11bef0d commit 311b569
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1821,7 +1821,20 @@ def search_data_breaches():

if alert_record and alert_record.get("shieldOn"):
raise ShieldOnException("Shield is on")
if include_sensitive:

if breach_record and not breach_record.get("site"):
return jsonify(
{
"BreachesSummary": {
"domain": "",
"site": "",
"tmpstmp": "",
},
"PastesSummary": {"cnt": 0, "domain": "", "tmpstmp": ""},
}
)

if breach_record and include_sensitive:
combined_breach_data = get_combined_breach_data(
breach_record, include_sensitive
)
Expand Down

0 comments on commit 311b569

Please sign in to comment.