Avoid null ref error when no organic online search results found

This commit is contained in:
Debanjum
2025-08-29 13:46:09 -07:00
parent 00f0d23224
commit 0babab580a

View File

@@ -645,7 +645,7 @@ def deduplicate_organic_results(online_results: dict) -> dict:
for query, results in online_results.items():
# Filter organic results keeping only first occurrence of each link
filtered_organic = []
for result in results.get("organic", []):
for result in results.get("organic") or []:
link = result.get("link")
if link and link not in seen_links:
seen_links.add(link)