From 311b569292238310960f5d9175d060007dce4217 Mon Sep 17 00:00:00 2001 From: DevaOnBreaches Date: Wed, 19 Jun 2024 09:11:21 +0530 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20chore:=20Add=20validation=20to?= =?UTF-8?q?=20filter=20empty=20site=20fields=20and=20prevent=20exceptions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index a0610fa..bfedd17 100755 --- a/main.py +++ b/main.py @@ -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 )